b36937e78cc6d01bf3a76144f60adda57633bd07
[doctor.git] / docs / userguide / doctor_scenario_in_functest.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 Doctor
5 ^^^^^^
6
7 Platform overview
8 """""""""""""""""
9
10 Doctor platform provides these features in `Colorado Release <https://wiki.opnfv.org/display/SWREL/Colorado>`_:
11
12 * Immediate Notification
13 * Consistent resource state awareness for compute host down
14 * Valid compute host status given to VM owner
15
16 These features enable high availability of Network Services on top of
17 the virtualized infrastructure. Immediate notification allows VNF managers
18 (VNFM) to process recovery actions promptly once a failure has occurred.
19
20 Consistency of resource state is necessary to execute recovery actions
21 properly in the VIM.
22
23 Ability to query host status gives VM owner the possibility to get
24 consistent state information through an API in case of a compute host
25 fault.
26
27 The Doctor platform consists of the following components:
28
29 * OpenStack Compute (Nova)
30 * OpenStack Telemetry (Ceilometer)
31 * OpenStack Alarming (Aodh)
32 * Doctor Inspector
33 * Doctor Monitor
34
35 .. note::
36     Doctor Inspector and Monitor are sample implementations for reference.
37
38 You can see an overview of the Doctor platform and how components interact in
39 :numref:`figure-p1`.
40
41 .. figure:: /platformoverview/images/figure-p1.png
42     :name: figure-p1
43     :width: 100%
44
45     Doctor platform and typical sequence (Colorado)
46
47 Detailed information on the Doctor architecture can be found in the Doctor
48 requirements documentation:
49 http://artifacts.opnfv.org/doctor/docs/requirements/05-implementation.html
50
51
52 Use case
53 """"""""
54
55 * A consumer of the NFVI wants to receive immediate notifications about faults
56   in the NFVI affecting the proper functioning of the virtual resources.
57   Therefore, such faults have to be detected as quickly as possible, and, when
58   a critical error is observed, the affected consumer is immediately informed
59   about the fault and can switch over to the STBY configuration.
60
61 The faults to be monitored (and at which detection rate) will be configured by
62 the consumer. Once a fault is detected, the Inspector in the Doctor
63 architecture will check the resource map maintained by the Controller, to find
64 out which virtual resources are affected and then update the resources state.
65 The Notifier will receive the failure event requests sent from the Controller,
66 and notify the consumer(s) of the affected resources according to the alarm
67 configuration.
68
69 Detailed workflow information is as follows:
70
71 * Consumer(VNFM): (step 0) creates resources (network, server/instance) and an
72   event alarm on state down notification of that server/instance
73
74 * Monitor: (step 1) periodically checks nodes, such as ping from/to each
75   dplane nic to/from gw of node, (step 2) once it fails to send out event
76   with "raw" fault event information to Inspector
77
78 * Inspector: when it receives an event, it will (step 3) mark the host down
79   ("mark-host-down"), (step 4) map the PM to VM, and change the VM status to
80   down
81
82 * Controller: (step 5) sends out instance update event to Ceilometer
83
84 * Notifier: (step 6) Ceilometer transforms and passes the event to Aodh,
85   (step 7) Aodh will evaluate event with the registered alarm definitions,
86   then (step 8) it will fire the alarm to the "consumer" who owns the
87   instance
88
89 * Consumer(VNFM): (step 9) receives the event and (step 10) recreates a new
90   instance
91
92 Test case
93 """""""""
94
95 Functest will call the "run.sh" script in Doctor to run the test job.
96
97 Currently, only 'Apex' and 'local' installer are supported.
98
99 The "run.sh" script will execute the following steps.
100
101 Firstly, prepare image for booting VM, then create a test project and test
102 user (both default to doctor) for the Doctor tests.
103
104 Secondly, boot a VM under the doctor project and check the VM status to verify
105 that the VM is launched completely. Then get the compute host info where the VM
106 is launched to verify connectivity to the target compute host. Get the consumer
107 ip according to the route to compute ip and create an alarm event in Ceilometer
108 using the consumer ip.
109
110 Thirdly, the Doctor components are started, and, based on the above preparation,
111 a failure is injected to the system, i.e. the network of compute host is
112 disabled for 3 minutes. To ensure the host is down, the status of the host
113 will be checked.
114
115 Finally, the notification time, i.e. the time between the execution of step 2
116 (Monitor detects failure) and step 9 (Consumer receives failure notification)
117 is calculated.
118
119 According to the Doctor requirements, the Doctor test is successful if the
120 notification time is below 1 second.