summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INFO1
-rw-r--r--docs/requirements/03-architecture.rst18
-rw-r--r--docs/requirements/05-implementation.rst116
-rw-r--r--tests/inspector.py2
-rw-r--r--tests/profiler-poc.py9
-rwxr-xr-xtests/run.sh28
6 files changed, 117 insertions, 57 deletions
diff --git a/INFO b/INFO
index 08c017fc..bb91b30e 100644
--- a/INFO
+++ b/INFO
@@ -21,7 +21,6 @@ Peter Lee (Corenova Technologies, peter@corenova.com)
Ryota Mibu (NEC, r-mibu@cq.jp.nec.com)
Serge Manning (Sprint, Serge.Manning@sprint.com)
Tomi Juvonen (Nokia, tomi.juvonen@nokia.com)
-Tommy Lindgren (Ericsson, tommy.lindgren@ericsson.com)
Uli Kleber (Huawei, ulrich.kleber@huawei.com)
Link to TSC approval of the project: http://meetbot.opnfv.org/meetings/opnfv-meeting/2014/opnfv-meeting.2014-12-02-14.58.html
diff --git a/docs/requirements/03-architecture.rst b/docs/requirements/03-architecture.rst
index d9ccd221..b7417691 100644
--- a/docs/requirements/03-architecture.rst
+++ b/docs/requirements/03-architecture.rst
@@ -191,11 +191,15 @@ fencing, but there has not been any progress. The general description is
available here:
https://wiki.openstack.org/wiki/Fencing_Instances_of_an_Unreachable_Host
-As OpenStack does not cover fencing it is in the responsibility of the Doctor
-project to make sure fencing is done by using tools like pacemaker and by
-calling OpenStack APIs. Only after fencing is done OpenStack resources can be
-marked as down. In case there are gaps in OpenStack projects to have all
-relevant resources marked as down, those gaps need to be identified and fixed.
+OpenStack provides some mechanisms that allow fencing of faulty resources. Some
+are automatically invoked by the platform itself (e.g. Nova disables the
+compute service when libvirtd stops running, preventing new VMs to be scheduled
+to that node), while other mechanisms are consumer trigger-based actions (e.g.
+Neutron port admin-state-up). For other fencing actions not supported by
+OpenStack, the Doctor project may suggest ways to address the gap (e.g. through
+means of resourcing to external tools and orchestration methods), or
+documenting or implementing them upstream.
+
The Doctor Inspector component will be responsible of marking resources down in
the OpenStack and back up if necessary.
@@ -206,11 +210,11 @@ In the basic :ref:`uc-fault1` use case, no automatic actions will be taken by
the VIM, but all recovery actions executed by the VIM and the NFVI will be
instructed and coordinated by the Consumer.
-In a more advanced use case, the VIM shall be able to recover the failed virtual
+In a more advanced use case, the VIM may be able to recover the failed virtual
resources according to a pre-defined behavior for that resource. In principle
this means that the owner of the resource (i.e., its consumer or administrator)
can define which recovery actions shall be taken by the VIM. Examples are a
-restart of the VM, migration/evacuation of the VM, or no action.
+restart of the VM or migration/evacuation of the VM.
diff --git a/docs/requirements/05-implementation.rst b/docs/requirements/05-implementation.rst
index 848d5a04..84979772 100644
--- a/docs/requirements/05-implementation.rst
+++ b/docs/requirements/05-implementation.rst
@@ -672,47 +672,81 @@ and correlated alarms. Instead the AODH alarm class has attributes for actions,
rules and user and project id.
-+------------------------+------------------------+------------------------+
-| ETSI NFV Alarm Type | OPNFV Doctor Req Spec | AODH Alarm Type |
-+========================+========================+========================+
-| AlarmId | FaultId | Alarm Id |
-+------------------------+------------------------+------------------------+
-| managedObjectId | virtualResourceId | (N/A) |
-+------------------------+------------------------+------------------------+
-| \- | \- | User_Id, Project_Id |
-+------------------------+------------------------+------------------------+
-| alarmRaisedTime | \- | (N/A) |
-+------------------------+------------------------+------------------------+
-| alarmChangedTime | \- | (N/A) |
-+------------------------+------------------------+------------------------+
-| alarmClearedTime | \- | (N/A) |
-+------------------------+------------------------+------------------------+
-| alarmState: | virtualResourceState | State: ok, alarm, |
-| New, Updated, Cleared | (e.g. normal, | insufficient data |
-| | maintenance, down, | |
-| | error) | |
-+------------------------+------------------------+------------------------+
-| vrPerceivedSeverity: | Severity (Integer) | Severity: low, |
-| Critical, Major, Minor,| | moderate, critical |
-| Warning, Indeterminate,| | |
-| Cleared | | |
-+------------------------+------------------------+------------------------+
-| eventTime (unclear?) | EventTime | (N/A) |
-+------------------------+------------------------+------------------------+
-| faultType | FaultType | type |
-+------------------------+------------------------+------------------------+
-| probableCause | ProbableCause | description |
-+------------------------+------------------------+------------------------+
-| isRootCause | IsRootCause | \- |
-+------------------------+------------------------+------------------------+
-| correlatedAlarmId | CorrelatedFaultId | \- |
-+------------------------+------------------------+------------------------+
-| faultDetails | FaultDetails | \- |
-+------------------------+------------------------+------------------------+
-| \- | \- | actions, rule, time |
-| | | constraints |
-+------------------------+------------------------+------------------------+
-
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| ETSI NFV Alarm Type | OPNFV Doctor | AODH Event Alarm | Description / Comment | Recommendations |
+| | Requirement Specs | Notification | | |
++========================+========================+=====================+=============================================+=======================================+
+| alarmId | FaultId | alarm_id | Identifier of an alarm. | \- |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| \- | \- | alarm_name | Human readable alarm name. | May be added in ETSI NFV Stage 3. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| managedObjectId | VirtualResourceId | (reason) | Identifier of the affected virtual resource | \- |
+| | | | is part of the AODH reason parameter. | |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| \- | \- | user_id, project_id | User and project identifiers. | May be added in ETSI NFV Stage 3. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| alarmRaisedTime | \- | \- | Timestamp when alarm was raised. | To be added to Doctor and AODH. May |
+| | | | | be derived (e.g. in a shimlayer) from |
+| | | | | the AODH alarm history. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| alarmChangedTime | \- | \- | Timestamp when alarm was changed/updated. | see above |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| alarmClearedTime | \- | \- | Timestamp when alarm was cleared. | see above |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| eventTime | \- | \- | Timestamp when alarm was first observed by | see above |
+| | | | the Monitor. | |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| \- | EventTime | generated | Timestamp of the Notification. | Update parameter name in Doctor spec. |
+| | | | | May be added in ETSI NFV Stage 3. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| state: | VirtualResourceState: | current: ok, alarm, | ETSI NFV IFA 005/006 lists example alarm | Maintenance state is missing in AODH. |
+| E.g. Fired, Updated | E.g. normal, down | insufficient_data | states. | List of alarm states will be |
+| Cleared | maintenance, error | | | specified in ETSI NFV Stage 3. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| perceivedSeverity: | Severity (Integer) | Severity: | ETSI NFV IFA 005/006 lists example | List of alarm states will be |
+| E.g. Critical, Major, | | low (default), | perceived severity values. | specified in ETSI NFV Stage 3. |
+| Minor, Warning, | | moderate, critical | | |
+| Indeterminate, Cleared | | | | **OPNFV: Severity (Integer)**: |
+| | | | | * update OPNFV Doctor specification |
+| | | | | to *Enum* |
+| | | | | |
+| | | | | **perceivedSeverity=Indetermined**: |
+| | | | | * remove value *Indetermined* in |
+| | | | | IFA and map undefined values to |
+| | | | | “minor” severity, or |
+| | | | | * add value *indetermined* in AODH |
+| | | | | and make it the default value. |
+| | | | | |
+| | | | | **perceivedSeverity=Cleared**: |
+| | | | | * remove value *Cleared* in IFA as |
+| | | | | the information about a cleared |
+| | | | | alarm alarm can be derived from |
+| | | | | the alarm state parameter, or |
+| | | | | * add value *cleared* in AODH and |
+| | | | | set a rule that the severity is |
+| | | | | “cleared” when the state is *ok*. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| faultType | FaultType | event_type in | Type of the fault, e.g. “CPU failure” of a | OpenStack Alarming (Aodh) can use a |
+| | | reason_data | compute resource, in machine interpretable | fuzzy matching with wildcard string, |
+| | | | format. | "compute.cpu.failure". |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| N/A | N/A | type = "event" | Type of the notification. For fault | \- |
+| | | | notifications the type in AODH is “event”. | |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| probableCause | ProbableCause | \- | Probable cause of the alarm. | May be provided (e.g. in a shimlayer) |
+| | | | | based on Vitrage topology awareness / |
+| | | | | root-cause-analysis. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| isRootCause | IsRootCause | \- | Boolean indicating whether the fault is the | see above |
+| | | | root cause of other faults. | |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| correlatedAlarmId | CorrelatedFaultId | \- | List of IDs of correlated faults. | see above |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| faultDetails | FaultDetails | \- | Additional details about the fault/alarm. | FaultDetails information element will |
+| | | | | be specified in ETSI NFV Stage 3. |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
+| \- | \- | action, previous | Additional AODH alarm related parameters. | \- |
++------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
Table: Comparison of alarm attributes
diff --git a/tests/inspector.py b/tests/inspector.py
index 3a0e9ade..c1f95697 100644
--- a/tests/inspector.py
+++ b/tests/inspector.py
@@ -54,6 +54,7 @@ class DoctorInspectorSample(object):
def disable_compute_host(self, hostname):
for server in self.servers[hostname]:
self.nova.servers.reset_state(server, 'error')
+ LOG.info('doctor mark vm(%s) error at %s' % (server, time.time()))
# NOTE: We use our own client here instead of this novaclient for a
# workaround. Once keystone provides v2.1 nova api endpoint
@@ -63,6 +64,7 @@ class DoctorInspectorSample(object):
# self.nova.services.force_down(hostname, 'nova-compute', True)
#
nova_force_down.force_down(hostname)
+ LOG.info('doctor mark host(%s) down at %s' % (hostname, time.time()))
app = Flask(__name__)
diff --git a/tests/profiler-poc.py b/tests/profiler-poc.py
index f20cad1c..71034781 100644
--- a/tests/profiler-poc.py
+++ b/tests/profiler-poc.py
@@ -18,8 +18,10 @@ Valid check points are: DOCTOR_PROFILER_T{00-09}
See also: https://goo.gl/98Osig
"""
+import json
import os
+LOGFILE = 'performance-profile'
PREFIX = 'DOCTOR_PROFILER'
TOTAL_CHECK_POINTS = 10
MODULE_CHECK_POINTS = ['T00', 'T01', 'T04', 'T05', 'T06', 'T09']
@@ -34,8 +36,8 @@ Total time cost: {total}(ms)
host down:{T00}| | | | | | | | |
raw failure:{T01}| | | | | | | |
found affected:{T02}| | | | | | |
- marked host down:{T03}| | | | | |
- set VM error:{T04} | | | | |
+ set VM error:{T03}| | | | | |
+ marked host down:{T04}| | | | |
notified VM error:{T05} | | | |
transformed event:{T06}| | |
evaluated event:{T07}| |
@@ -76,6 +78,9 @@ def main():
profile = TEMPLATE.format(**tags)
+ logfile = open('{}.json'.format(LOGFILE), 'w')
+ logfile.write(json.dumps(tags))
+
print profile
if __name__ == '__main__':
diff --git a/tests/run.sh b/tests/run.sh
index 1b21f09f..206f6a40 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -27,6 +27,7 @@ DOCTOR_PW=doctor
DOCTOR_PROJECT=doctor
#TODO: change back to `_member_` when JIRA DOCTOR-55 is done
DOCTOR_ROLE=admin
+PROFILER_TYPE=${PROFILER_TYPE:-none}
TOP_DIR=$(cd $(dirname "$0") && pwd)
@@ -248,21 +249,36 @@ END_TXT
}
profile_performance_poc() {
- total=`python -c "print(int(($notified-$detected)*1000))"`
-
+ triggered=$(grep "^doctor set host down at" disable_network.log |\
+ sed -e "s/^.* at //")
+ vmdown=$(grep "doctor mark vm.* error at" inspector.log |tail -n 1 |\
+ sed -e "s/^.* at //")
+ hostdown=$(grep "doctor mark host.* down at" inspector.log |\
+ sed -e "s/^.* at //")
+
+ #calculate the relative interval to triggered(T00)
export DOCTOR_PROFILER_T00=0
- export DOCTOR_PROFILER_T09=$((total))
+ export DOCTOR_PROFILER_T01=$(echo "($detected-$triggered)*1000/1" |bc)
+ export DOCTOR_PROFILER_T03=$(echo "($vmdown-$triggered)*1000/1" |bc)
+ export DOCTOR_PROFILER_T04=$(echo "($hostdown-$triggered)*1000/1" |bc)
+ export DOCTOR_PROFILER_T09=$(echo "($notified-$triggered)*1000/1" |bc)
+
python profiler-poc.py
}
calculate_notification_time() {
- detected=$(grep "doctor monitor detected at" monitor.log | awk '{print $10}')
- notified=$(grep "doctor consumer notified at" consumer.log | awk '{print $10}')
if ! grep -q "doctor consumer notified at" consumer.log ; then
die $LINENO "Consumer hasn't received fault notification."
fi
- if [[ PROFILER == 'poc' ]]; then
+ #keep 'at' as the last keyword just before the value, and
+ #use regex to get value instead of the fixed column
+ detected=$(grep "doctor monitor detected at" monitor.log |\
+ sed -e "s/^.* at //")
+ notified=$(grep "doctor consumer notified at" consumer.log |\
+ sed -e "s/^.* at //")
+
+ if [[ "$PROFILER_TYPE" == "poc" ]]; then
profile_performance_poc
fi