849797723c7a472fd14da46bd866aafeee6c25a1
[doctor.git] / docs / development / requirements / 05-implementation.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 Detailed architecture and interface specification
5 =================================================
6
7 This section describes a detailed implementation plan, which is based on the
8 high level architecture introduced in Section 3. Section 5.1 describes the
9 functional blocks of the Doctor architecture, which is followed by a high level
10 message flow in Section 5.2. Section 5.3 provides a mapping of selected existing
11 open source components to the building blocks of the Doctor architecture.
12 Thereby, the selection of components is based on their maturity and the gap
13 analysis executed in Section 4. Sections 5.4 and 5.5 detail the specification of
14 the related northbound interface and the related information elements. Finally,
15 Section 5.6 provides a first set of blueprints to address selected gaps required
16 for the realization functionalities of the Doctor project.
17
18 .. _impl_fb:
19
20 Functional Blocks
21 -----------------
22
23 This section introduces the functional blocks to form the VIM. OpenStack was
24 selected as the candidate for implementation. Inside the VIM, 4 different
25 building blocks are defined (see :numref:`figure6`).
26
27 .. figure:: images/figure6.png
28    :name: figure6
29    :width: 100%
30
31    Functional blocks
32
33 Monitor
34 ^^^^^^^
35
36 The Monitor module has the responsibility for monitoring the virtualized
37 infrastructure. There are already many existing tools and services (e.g. Zabbix)
38 to monitor different aspects of hardware and software resources which can be
39 used for this purpose.
40
41 Inspector
42 ^^^^^^^^^
43
44 The Inspector module has the ability a) to receive various failure notifications
45 regarding physical resource(s) from Monitor module(s), b) to find the affected
46 virtual resource(s) by querying the resource map in the Controller, and c) to
47 update the state of the virtual resource (and physical resource).
48
49 The Inspector has drivers for different types of events and resources to
50 integrate any type of Monitor and Controller modules. It also uses a failure
51 policy database to decide on the failure selection and aggregation from raw
52 events. This failure policy database is configured by the Administrator.
53
54 The reason for separation of the Inspector and Controller modules is to make the
55 Controller focus on simple operations by avoiding a tight integration of various
56 health check mechanisms into the Controller.
57
58 Controller
59 ^^^^^^^^^^
60
61 The Controller is responsible for maintaining the resource map (i.e. the mapping
62 from physical resources to virtual resources), accepting update requests for the
63 resource state(s) (exposing as provider API), and sending all failure events
64 regarding virtual resources to the Notifier. Optionally, the Controller has the
65 ability to force the state of a given physical resource to down in the resource
66 mapping when it receives failure notifications from the Inspector for that
67 given physical resource.
68 The Controller also re-calculates the capacity of the NVFI when receiving a
69 failure notification for a physical resource.
70
71 In a real-world deployment, the VIM may have several controllers, one for each
72 resource type, such as Nova, Neutron and Cinder in OpenStack. Each controller
73 maintains a database of virtual and physical resources which shall be the master
74 source for resource information inside the VIM.
75
76 Notifier
77 ^^^^^^^^
78
79 The focus of the Notifier is on selecting and aggregating failure events
80 received from the controller based on policies mandated by the Consumer.
81 Therefore, it allows the Consumer to subscribe for alarms regarding virtual
82 resources using a method such as API endpoint. After receiving a fault
83 event from a Controller, it will notify the fault to the Consumer by referring
84 to the alarm configuration which was defined by the Consumer earlier on.
85
86 To reduce complexity of the Controller, it is a good approach for the
87 Controllers to emit all notifications without any filtering mechanism and have
88 another service (i.e. Notifier) handle those notifications properly. This is the
89 general philosophy of notifications in OpenStack. Note that a fault message
90 consumed by the Notifier is different from the fault message received by the
91 Inspector; the former message is related to virtual resources which are visible
92 to users with relevant ownership, whereas the latter is related to raw devices
93 or small entities which should be handled with an administrator privilege.
94
95 The northbound interface between the Notifier and the Consumer/Administrator is
96 specified in :ref:`impl_nbi`.
97
98 Sequence
99 --------
100
101 Fault Management
102 ^^^^^^^^^^^^^^^^
103
104 The detailed work flow for fault management is as follows (see also :numref:`figure7`):
105
106 1. Request to subscribe to monitor specific virtual resources. A query filter
107    can be used to narrow down the alarms the Consumer wants to be informed
108    about.
109 2. Each subscription request is acknowledged with a subscribe response message.
110    The response message contains information about the subscribed virtual
111    resources, in particular if a subscribed virtual resource is in "alarm"
112    state.
113 3. The NFVI sends monitoring events for resources the VIM has been subscribed
114    to. Note: this subscription message exchange between the VIM and NFVI is not
115    shown in this message flow.
116 4. Event correlation, fault detection and aggregation in VIM.
117 5. Database lookup to find the virtual resources affected by the detected fault.
118 6. Fault notification to Consumer.
119 7. The Consumer switches to standby configuration (STBY)
120 8. Instructions to VIM requesting certain actions to be performed on the
121    affected resources, for example migrate/update/terminate specific
122    resource(s). After reception of such instructions, the VIM is executing the
123    requested action, e.g. it will migrate or terminate a virtual resource.
124 a. Query request from Consumer to VIM to get information about the current
125    status of a resource.
126 b. Response to the query request with information about the current status of
127    the queried resource. In case the resource is in "fault" state, information
128    about the related fault(s) is returned.
129
130 In order to allow for quick reaction to failures, the time interval between
131 fault detection in step 3 and the corresponding recovery actions in step 7 and 8
132 shall be less than 1 second.
133
134 .. figure:: images/figure7.png
135    :name: figure7
136    :width: 100%
137
138    Fault management work flow
139
140 .. figure:: images/figure8.png
141    :name: figure8
142    :width: 100%
143
144    Fault management scenario
145
146 :numref:`figure8` shows a more detailed message flow (Steps 4 to 6) between
147 the 4 building blocks introduced in :ref:`impl_fb`.
148
149 4. The Monitor observed a fault in the NFVI and reports the raw fault to the
150    Inspector.
151    The Inspector filters and aggregates the faults using pre-configured
152    failure policies.
153
154 5.
155    a) The Inspector queries the Resource Map to find the virtual resources
156    affected by the raw fault in the NFVI.
157    b) The Inspector updates the state of the affected virtual resources in the
158    Resource Map.
159    c) The Controller observes a change of the virtual resource state and informs
160    the Notifier about the state change and the related alarm(s).
161    Alternatively, the Inspector may directly inform the Notifier about it.
162
163 6. The Notifier is performing another filtering and aggregation of the changes
164    and alarms based on the pre-configured alarm configuration. Finally, a fault
165    notification is sent to northbound to the Consumer.
166
167 NFVI Maintenance
168 ^^^^^^^^^^^^^^^^
169 .. figure:: images/figure9.png
170    :name: figure9
171    :width: 100%
172
173    NFVI maintenance work flow
174
175 The detailed work flow for NFVI maintenance is shown in :numref:`figure9`
176 and has the following steps. Note that steps 1, 2, and 5 to 8a in the NFVI
177 maintenance work flow are very similar to the steps in the fault management work
178 flow and share a similar implementation plan in Release 1.
179
180 1. Subscribe to fault/maintenance notifications.
181 2. Response to subscribe request.
182 3. Maintenance trigger received from administrator.
183 4. VIM switches NFVI resources to "maintenance" state. This, e.g., means they
184    should not be used for further allocation/migration requests
185 5. Database lookup to find the virtual resources affected by the detected
186    maintenance operation.
187 6. Maintenance notification to Consumer.
188 7. The Consumer switches to standby configuration (STBY)
189 8. Instructions from Consumer to VIM requesting certain recovery actions to be
190    performed (step 8a). After reception of such instructions, the VIM is
191    executing the requested action in order to empty the physical resources (step
192    8b).
193 9. Maintenance response from VIM to inform the Administrator that the physical
194    machines have been emptied (or the operation resulted in an error state).
195 10. Administrator is coordinating and executing the maintenance operation/work
196     on the NFVI.
197 a) Query request from Administrator to VIM to get information about the
198    current state of a resource.
199 b) Response to the query request with information about the current state of
200    the queried resource(s). In case the resource is in "maintenance" state,
201    information about the related maintenance operation is returned.
202
203 .. figure:: images/figure10.png
204    :name: figure10
205    :width: 100%
206
207    NFVI Maintenance implementation plan
208
209 :numref:`figure10` shows a more detailed message flow (Steps 3 to 6 and 9)
210 between the 4 building blocks introduced in Section 5.1..
211
212 3. The Administrator is sending a StateChange request to the Controller residing
213    in the VIM.
214 4. The Controller queries the Resource Map to find the virtual resources
215    affected by the planned maintenance operation.
216 5.
217
218   a) The Controller updates the state of the affected virtual resources in the
219   Resource Map database.
220
221   b) The Controller informs the Notifier about the virtual resources that will
222   be affected by the maintenance operation.
223
224 6. A maintenance notification is sent to northbound to the Consumer.
225
226 ...
227
228 9. The Controller informs the Administrator after the physical resources have
229    been freed.
230
231
232
233 Implementation plan for OPNFV Release 1
234 ---------------------------------------
235
236 Fault management
237 ^^^^^^^^^^^^^^^^
238
239 :numref:`figure11` shows the implementation plan based on OpenStack and
240 related components as planned for Release 1. Hereby, the Monitor can be realized
241 by Zabbix. The Controller is realized by OpenStack Nova [NOVA]_, Neutron
242 [NEUT]_, and Cinder [CIND]_ for compute, network, and storage,
243 respectively. The Inspector can be realized by Monasca [MONA]_ or a simple
244 script querying Nova in order to map between physical and virtual resources. The
245 Notifier will be realized by Ceilometer [CEIL]_ receiving failure events
246 on its notification bus.
247
248 :numref:`figure12` shows the inner-workings of Ceilometer. After receiving
249 an "event" on its notification bus, first a notification agent will grab the
250 event and send a "notification" to the Collector. The collector writes the
251 notifications received to the Ceilometer databases.
252
253 In the existing Ceilometer implementation, an alarm evaluator is periodically
254 polling those databases through the APIs provided. If it finds new alarms, it
255 will evaluate them based on the pre-defined alarm configuration, and depending
256 on the configuration, it will hand a message to the Alarm Notifier, which in
257 turn will send the alarm message northbound to the Consumer. :numref:`figure12`
258 also shows an optimized work flow for Ceilometer with the goal to
259 reduce the delay for fault notifications to the Consumer. The approach is to
260 implement a new notification agent (called "publisher" in Ceilometer
261 terminology) which is directly sending the alarm through the "Notification Bus"
262 to a new "Notification-driven Alarm Evaluator (NAE)" (see Sections 5.6.2 and
263 5.6.3), thereby bypassing the Collector and avoiding the additional delay of the
264 existing polling-based alarm evaluator. The NAE is similar to the OpenStack
265 "Alarm Evaluator", but is triggered by incoming notifications instead of
266 periodically polling the OpenStack "Alarms" database for new alarms. The
267 Ceilometer "Alarms" database can hold three states: "normal", "insufficient
268 data", and "fired". It is representing a persistent alarm database. In order to
269 realize the Doctor requirements, we need to define new "meters" in the database
270 (see Section 5.6.1).
271
272 .. figure:: images/figure11.png
273    :name: figure11
274    :width: 100%
275
276    Implementation plan in OpenStack (OPNFV Release 1 ”Arno”)
277
278
279 .. figure:: images/figure12.png
280    :name: figure12
281    :width: 100%
282
283    Implementation plan in Ceilometer architecture
284
285
286 NFVI Maintenance
287 ^^^^^^^^^^^^^^^^
288
289 For NFVI Maintenance, a quite similar implementation plan exists. Instead of a
290 raw fault being observed by the Monitor, the Administrator is sending a
291 Maintenance Request through the northbound interface towards the Controller
292 residing in the VIM. Similar to the Fault Management use case, the Controller
293 (in our case OpenStack Nova) will send a maintenance event to the Notifier (i.e.
294 Ceilometer in our implementation). Within Ceilometer, the same workflow as
295 described in the previous section applies. In addition, the Controller(s) will
296 take appropriate actions to evacuate the physical machines in order to prepare
297 them for the planned maintenance operation. After the physical machines are
298 emptied, the Controller will inform the Administrator that it can initiate the
299 maintenance. Alternatively the VMs can just be shut down and boot up on the
300 same host after maintenance is over. There needs to be policy for administrator
301 to know the plan for VMs in maintenance.
302
303 Information elements
304 --------------------
305
306 This section introduces all attributes and information elements used in the
307 messages exchange on the northbound interfaces between the VIM and the VNFO and
308 VNFM.
309
310 Note: The information elements will be aligned with current work in ETSI NFV IFA
311 working group.
312
313
314 Simple information elements:
315
316 * SubscriptionID (Identifier): identifies a subscription to receive fault or maintenance
317   notifications.
318 * NotificationID (Identifier): identifies a fault or maintenance notification.
319 * VirtualResourceID (Identifier): identifies a virtual resource affected by a
320   fault or a maintenance action of the underlying physical resource.
321 * PhysicalResourceID (Identifier): identifies a physical resource affected by a
322   fault or maintenance action.
323 * VirtualResourceState (String): state of a virtual resource, e.g. "normal",
324   "maintenance", "down", "error".
325 * PhysicalResourceState (String): state of a physical resource, e.g. "normal",
326   "maintenance", "down", "error".
327 * VirtualResourceType (String): type of the virtual resource, e.g. "virtual
328   machine", "virtual memory", "virtual storage", "virtual CPU", or "virtual
329   NIC".
330 * FaultID (Identifier): identifies the related fault in the underlying physical
331   resource. This can be used to correlate different fault notifications caused
332   by the same fault in the physical resource.
333 * FaultType (String): Type of the fault. The allowed values for this parameter
334   depend on the type of the related physical resource. For example, a resource
335   of type "compute hardware" may have faults of type "CPU failure", "memory
336   failure", "network card failure", etc.
337 * Severity (Integer): value expressing the severity of the fault. The higher the
338   value, the more severe the fault.
339 * MinSeverity (Integer): value used in filter information elements. Only faults
340   with a severity higher than the MinSeverity value will be notified to the
341   Consumer.
342 * EventTime (Datetime): Time when the fault was observed.
343 * EventStartTime and EventEndTime (Datetime): Datetime range that can be used in
344   a FaultQueryFilter to narrow down the faults to be queried.
345 * ProbableCause (String): information about the probable cause of the fault.
346 * CorrelatedFaultID (Integer): list of other faults correlated to this fault.
347 * isRootCause (Boolean): Parameter indicating if this fault is the root for
348   other correlated faults. If TRUE, then the faults listed in the parameter
349   CorrelatedFaultID are caused by this fault.
350 * FaultDetails (Key-value pair): provides additional information about the
351   fault, e.g. information about the threshold, monitored attributes, indication
352   of the trend of the monitored parameter.
353 * FirmwareVersion (String): current version of the firmware of a physical
354   resource.
355 * HypervisorVersion (String): current version of a hypervisor.
356 * ZoneID (Identifier): Identifier of the resource zone. A resource zone is the
357   logical separation of physical and software resources in an NFVI deployment
358   for physical isolation, redundancy, or administrative designation.
359 * Metadata (Key-value pair): provides additional information of a physical
360   resource in maintenance/error state.
361
362 Complex information elements (see also UML diagrams in :numref:`figure13`
363 and :numref:`figure14`):
364
365 * VirtualResourceInfoClass:
366
367   + VirtualResourceID [1] (Identifier)
368   + VirtualResourceState [1] (String)
369   + Faults [0..*] (FaultClass): For each resource, all faults
370     including detailed information about the faults are provided.
371
372 * FaultClass: The parameters of the FaultClass are partially based on ETSI TS
373   132 111-2 (V12.1.0) [*]_, which is specifying fault management in 3GPP, in
374   particular describing the information elements used for alarm notifications.
375
376   - FaultID [1] (Identifier)
377   - FaultType [1] (String)
378   - Severity [1] (Integer)
379   - EventTime [1] (Datetime)
380   - ProbableCause [1] (String)
381   - CorrelatedFaultID [0..*] (Identifier)
382   - FaultDetails [0..*] (Key-value pair)
383
384 .. [*] http://www.etsi.org/deliver/etsi_ts/132100_132199/13211102/12.01.00_60/ts_13211102v120100p.pdf
385
386 * SubscribeFilterClass
387
388   - VirtualResourceType [0..*] (String)
389   - VirtualResourceID [0..*] (Identifier)
390   - FaultType [0..*] (String)
391   - MinSeverity [0..1] (Integer)
392
393 * FaultQueryFilterClass: narrows down the FaultQueryRequest, for example it
394   limits the query to certain physical resources, a certain zone, a given fault
395   type/severity/cause, or a specific FaultID.
396
397   - VirtualResourceType [0..*] (String)
398   - VirtualResourceID [0..*] (Identifier)
399   - FaultType [0..*] (String)
400   - MinSeverity [0..1] (Integer)
401   - EventStartTime [0..1] (Datetime)
402   - EventEndTime [0..1] (Datetime)
403
404 * PhysicalResourceStateClass:
405
406   - PhysicalResourceID [1] (Identifier)
407   - PhysicalResourceState [1] (String): mandates the new state of the physical
408     resource.
409   - Metadata [0..*] (Key-value pair)
410
411 * PhysicalResourceInfoClass:
412
413   - PhysicalResourceID [1] (Identifier)
414   - PhysicalResourceState [1] (String)
415   - FirmwareVersion [0..1] (String)
416   - HypervisorVersion [0..1] (String)
417   - ZoneID [0..1] (Identifier)
418   - Metadata [0..*] (Key-value pair)
419
420 * StateQueryFilterClass: narrows down a StateQueryRequest, for example it limits
421   the query to certain physical resources, a certain zone, or a given resource
422   state (e.g., only resources in "maintenance" state).
423
424   - PhysicalResourceID [1] (Identifier)
425   - PhysicalResourceState [1] (String)
426   - ZoneID [0..1] (Identifier)
427
428 .. _impl_nbi:
429
430 Detailed northbound interface specification
431 -------------------------------------------
432
433 This section is specifying the northbound interfaces for fault management and
434 NFVI maintenance between the VIM on the one end and the Consumer and the
435 Administrator on the other ends. For each interface all messages and related
436 information elements are provided.
437
438 Note: The interface definition will be aligned with current work in ETSI NFV IFA
439 working group .
440
441 All of the interfaces described below are produced by the VIM and consumed by
442 the Consumer or Administrator.
443
444 Fault management interface
445 ^^^^^^^^^^^^^^^^^^^^^^^^^^
446
447 This interface allows the VIM to notify the Consumer about a virtual resource
448 that is affected by a fault, either within the virtual resource itself or by the
449 underlying virtualization infrastructure. The messages on this interface are
450 shown in :numref:`figure13` and explained in detail in the following
451 subsections.
452
453 Note: The information elements used in this section are described in detail in
454 Section 5.4.
455
456 .. figure:: images/figure13.png
457    :name: figure13
458    :width: 100%
459
460    Fault management NB I/F messages
461
462
463 SubscribeRequest (Consumer -> VIM)
464 __________________________________
465
466 Subscription from Consumer to VIM to be notified about faults of specific
467 resources. The faults to be notified about can be narrowed down using a
468 subscribe filter.
469
470 Parameters:
471
472 - SubscribeFilter [1] (SubscribeFilterClass): Optional information to narrow
473   down the faults that shall be notified to the Consumer, for example limit to
474   specific VirtualResourceID(s), severity, or cause of the alarm.
475
476 SubscribeResponse (VIM -> Consumer)
477 ___________________________________
478
479 Response to a subscribe request message including information about the
480 subscribed resources, in particular if they are in "fault/error" state.
481
482 Parameters:
483
484 * SubscriptionID [1] (Identifier): Unique identifier for the subscription. It
485   can be used to delete or update the subscription.
486 * VirtualResourceInfo [0..*] (VirtualResourceInfoClass): Provides additional
487   information about the subscribed resources, i.e., a list of the related
488   resources, the current state of the resources, etc.
489
490 FaultNotification (VIM -> Consumer)
491 ___________________________________
492
493 Notification about a virtual resource that is affected by a fault, either within
494 the virtual resource itself or by the underlying virtualization infrastructure.
495 After reception of this request, the Consumer will decide on the optimal
496 action to resolve the fault. This includes actions like switching to a hot
497 standby virtual resource, migration of the fault virtual resource to another
498 physical machine, termination of the faulty virtual resource and instantiation
499 of a new virtual resource in order to provide a new hot standby resource. In
500 some use cases the Consumer can leave virtual resources on failed host to be
501 booted up again after fault is recovered. Existing resource management
502 interfaces and messages between the Consumer and the VIM can be used for those
503 actions, and there is no need to define additional actions on the Fault
504 Management Interface.
505
506 Parameters:
507
508 * NotificationID [1] (Identifier): Unique identifier for the notification.
509 * VirtualResourceInfo [1..*] (VirtualResourceInfoClass): List of faulty
510   resources with detailed information about the faults.
511
512 FaultQueryRequest (Consumer -> VIM)
513 ___________________________________
514
515 Request to find out about active alarms at the VIM. A FaultQueryFilter can be
516 used to narrow down the alarms returned in the response message.
517
518 Parameters:
519
520 * FaultQueryFilter [1] (FaultQueryFilterClass): narrows down the
521   FaultQueryRequest, for example it limits the query to certain physical
522   resources, a certain zone, a given fault type/severity/cause, or a specific
523   FaultID.
524
525 FaultQueryResponse (VIM -> Consumer)
526 ____________________________________
527
528 List of active alarms at the VIM matching the FaultQueryFilter specified in the
529 FaultQueryRequest.
530
531 Parameters:
532
533 * VirtualResourceInfo [0..*] (VirtualResourceInfoClass): List of faulty
534   resources. For each resource all faults including detailed information about
535   the faults are provided.
536
537 NFVI maintenance
538 ^^^^^^^^^^^^^^^^
539
540 The NFVI maintenance interfaces Consumer-VIM allows the Consumer to subscribe to
541 maintenance notifications provided by the VIM. The related maintenance interface
542 Administrator-VIM allows the Administrator to issue maintenance requests to the
543 VIM, i.e. requesting the VIM to take appropriate actions to empty physical
544 machine(s) in order to execute maintenance operations on them. The interface
545 also allows the Administrator to query the state of physical machines, e.g., in
546 order to get details in the current status of the maintenance operation like a
547 firmware update.
548
549 The messages defined in these northbound interfaces are shown in :numref:`figure14`
550 and described in detail in the following subsections.
551
552 .. figure:: images/figure14.png
553    :name: figure14
554    :width: 100%
555
556    NFVI maintenance NB I/F messages
557
558 SubscribeRequest (Consumer -> VIM)
559 __________________________________
560
561 Subscription from Consumer to VIM to be notified about maintenance operations
562 for specific virtual resources. The resources to be informed about can be
563 narrowed down using a subscribe filter.
564
565 Parameters:
566
567 * SubscribeFilter [1] (SubscribeFilterClass): Information to narrow down the
568   faults that shall be notified to the Consumer, for example limit to specific
569   virtual resource type(s).
570
571 SubscribeResponse (VIM -> Consumer)
572 ___________________________________
573
574 Response to a subscribe request message, including information about the
575 subscribed virtual resources, in particular if they are in "maintenance" state.
576
577 Parameters:
578
579 * SubscriptionID [1] (Identifier): Unique identifier for the subscription. It
580   can be used to delete or update the subscription.
581 * VirtualResourceInfo [0..*] (VirtalResourceInfoClass): Provides additional
582   information about the subscribed virtual resource(s), e.g., the ID, type and
583   current state of the resource(s).
584
585 MaintenanceNotification (VIM -> Consumer)
586 _________________________________________
587
588 Notification about a physical resource switched to "maintenance" state. After
589 reception of this request, the Consumer will decide on the optimal action to
590 address this request, e.g., to switch to the standby (STBY) configuration.
591
592 Parameters:
593
594 * VirtualResourceInfo [1..*] (VirtualResourceInfoClass): List of virtual
595   resources where the state has been changed to maintenance.
596
597 StateChangeRequest (Administrator -> VIM)
598 _________________________________________
599
600 Request to change the state of a list of physical resources, e.g. to
601 "maintenance" state, in order to prepare them for a planned maintenance
602 operation.
603
604 Parameters:
605
606 * PhysicalResourceState [1..*] (PhysicalResourceStateClass)
607
608 StateChangeResponse (VIM -> Administrator)
609 __________________________________________
610
611 Response message to inform the Administrator that the requested resources are
612 now in maintenance state (or the operation resulted in an error) and the
613 maintenance operation(s) can be executed.
614
615 Parameters:
616
617 * PhysicalResourceInfo [1..*] (PhysicalResourceInfoClass)
618
619 StateQueryRequest (Administrator -> VIM)
620 ________________________________________
621
622 In this procedure, the Administrator would like to get the information about
623 physical machine(s), e.g. their state ("normal", "maintenance"), firmware
624 version, hypervisor version, update status of firmware and hypervisor, etc. It
625 can be used to check the progress during firmware update and the confirmation
626 after update. A filter can be used to narrow down the resources returned in the
627 response message.
628
629 Parameters:
630
631 * StateQueryFilter [1] (StateQueryFilterClass): narrows down the
632   StateQueryRequest, for example it limits the query to certain physical
633   resources, a certain zone, or a given resource state.
634
635 StateQueryResponse (VIM -> Administrator)
636 _________________________________________
637
638 List of physical resources matching the filter specified in the
639 StateQueryRequest.
640
641 Parameters:
642
643 * PhysicalResourceInfo [0..*] (PhysicalResourceInfoClass): List of physical
644   resources. For each resource, information about the current state, the
645   firmware version, etc. is provided.
646
647 NFV IFA, OPNFV Doctor and AODH alarms
648 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
649
650 This section compares the alarm interfaces of ETSI NFV IFA with the specifications
651 of this document and the alarm class of AODH.
652
653 ETSI NFV specifies an interface for alarms from virtualised resources in ETSI GS
654 NFV-IFA 005 [ENFV]_. The interface specifies an Alarm class and two notifications plus
655 operations to query alarm instances and to subscribe to the alarm notifications.
656
657 The specification in this document has a structure that is very similar to the
658 ETSI NFV specifications. The notifications differ in that an alarm notification
659 in the NFV interface defines a single fault for a single resource while the
660 notification specified in this document can contain multiple faults for
661 multiple resources. The Doctor specification is lacking the detailed time stamps
662 of the NFV specification essential for synchronizaion of the alarm list
663 using the query operation. The detailed time stamps are also of value in the event
664 and alarm history DBs.
665
666 AODH defines a base class for alarms, not the notifications. This means that
667 some of the dynamic attributes of the ETSI NFV alarm type, like alarmRaisedTime,
668 are not applicable to the AODH alarm class but are attributes of in the actual
669 notifications. (Description of these attributes will be added later.)  The AODH alarm
670 class is lacking some attributes present in the NFV specification, fault details
671 and correlated alarms. Instead the AODH alarm class has attributes for actions,
672 rules and user and project id.
673
674
675 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
676 | ETSI NFV Alarm Type    | OPNFV Doctor           | AODH Event Alarm    | Description / Comment                       | Recommendations                       |
677 |                        | Requirement Specs      | Notification        |                                             |                                       |
678 +========================+========================+=====================+=============================================+=======================================+
679 | alarmId                | FaultId                | alarm_id            | Identifier of an alarm.                     | \-                                    |
680 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
681 | \-                     | \-                     | alarm_name          | Human readable alarm name.                  | May be added in ETSI NFV Stage 3.     |
682 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
683 | managedObjectId        | VirtualResourceId      | (reason)            | Identifier of the affected virtual resource | \-                                    |
684 |                        |                        |                     | is part of the AODH reason parameter.       |                                       |
685 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
686 | \-                     | \-                     | user_id, project_id | User and project identifiers.               | May be added in ETSI NFV Stage 3.     |
687 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
688 | alarmRaisedTime        | \-                     | \-                  | Timestamp when alarm was raised.            | To be added to Doctor and AODH. May   |
689 |                        |                        |                     |                                             | be derived (e.g. in a shimlayer) from |
690 |                        |                        |                     |                                             | the AODH alarm history.               |
691 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
692 | alarmChangedTime       | \-                     | \-                  | Timestamp when alarm was changed/updated.   | see above                             |
693 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
694 | alarmClearedTime       | \-                     | \-                  | Timestamp when alarm was cleared.           | see above                             |
695 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
696 | eventTime              | \-                     | \-                  | Timestamp when alarm was first observed by  | see above                             |
697 |                        |                        |                     | the Monitor.                                |                                       |
698 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
699 | \-                     | EventTime              | generated           | Timestamp of the Notification.              | Update parameter name in Doctor spec. |
700 |                        |                        |                     |                                             | May be added in ETSI NFV Stage 3.     |
701 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
702 | state:                 | VirtualResourceState:  | current: ok, alarm, | ETSI NFV IFA 005/006 lists example alarm    | Maintenance state is missing in AODH. |
703 | E.g. Fired, Updated    | E.g. normal, down      | insufficient_data   | states.                                     | List of alarm states will be          |
704 | Cleared                | maintenance, error     |                     |                                             | specified in ETSI NFV Stage 3.        |
705 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
706 | perceivedSeverity:     | Severity (Integer)     | Severity:           | ETSI NFV IFA 005/006 lists example          | List of alarm states will be          |
707 | E.g. Critical, Major,  |                        | low (default),      | perceived severity values.                  | specified in ETSI NFV Stage 3.        |
708 | Minor, Warning,        |                        | moderate, critical  |                                             |                                       |
709 | Indeterminate, Cleared |                        |                     |                                             | **OPNFV: Severity (Integer)**:        |
710 |                        |                        |                     |                                             |   * update OPNFV Doctor specification |
711 |                        |                        |                     |                                             |     to *Enum*                         |
712 |                        |                        |                     |                                             |                                       |
713 |                        |                        |                     |                                             | **perceivedSeverity=Indetermined**:   |
714 |                        |                        |                     |                                             |   * remove value *Indetermined* in    |
715 |                        |                        |                     |                                             |     IFA and map undefined values to   |
716 |                        |                        |                     |                                             |     “minor” severity, or              |
717 |                        |                        |                     |                                             |   * add value *indetermined* in AODH  |
718 |                        |                        |                     |                                             |     and make it the default value.    |
719 |                        |                        |                     |                                             |                                       |
720 |                        |                        |                     |                                             | **perceivedSeverity=Cleared**:        |
721 |                        |                        |                     |                                             |   * remove value *Cleared* in IFA as  |
722 |                        |                        |                     |                                             |     the information about a cleared   |
723 |                        |                        |                     |                                             |     alarm alarm can be derived from   |
724 |                        |                        |                     |                                             |     the alarm state parameter, or     |
725 |                        |                        |                     |                                             |   * add value *cleared* in AODH and   |
726 |                        |                        |                     |                                             |     set a rule that the severity is   |
727 |                        |                        |                     |                                             |     “cleared” when the state is *ok*. |
728 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
729 | faultType              | FaultType              | event_type in       | Type of the fault, e.g. “CPU failure” of a  | OpenStack Alarming (Aodh) can use a   |
730 |                        |                        | reason_data         | compute resource, in machine interpretable  | fuzzy matching with wildcard string,  |
731 |                        |                        |                     | format.                                     | "compute.cpu.failure".                |
732 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
733 | N/A                    | N/A                    | type = "event"      | Type of the notification. For fault         | \-                                    |
734 |                        |                        |                     | notifications the type in AODH is “event”.  |                                       |
735 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
736 | probableCause          | ProbableCause          | \-                  | Probable cause of the alarm.                | May be provided (e.g. in a shimlayer) |
737 |                        |                        |                     |                                             | based on Vitrage topology awareness / |
738 |                        |                        |                     |                                             | root-cause-analysis.                  |
739 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
740 | isRootCause            | IsRootCause            | \-                  | Boolean indicating whether the fault is the | see above                             |
741 |                        |                        |                     | root cause of other faults.                 |                                       |
742 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
743 | correlatedAlarmId      | CorrelatedFaultId      | \-                  | List of IDs of correlated faults.           | see above                             |
744 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
745 | faultDetails           | FaultDetails           | \-                  | Additional details about the fault/alarm.   | FaultDetails information element will |
746 |                        |                        |                     |                                             | be specified in ETSI NFV Stage 3.     |
747 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
748 | \-                     | \-                     | action, previous    | Additional AODH alarm related parameters.   | \-                                    |
749 +------------------------+------------------------+---------------------+---------------------------------------------+---------------------------------------+
750
751 Table: Comparison of alarm attributes
752
753 The primary area of improvement should be alignment of the perceived severity. This
754 is important for a quick and accurate evaluation of the alarm. AODH thus should
755 support also the X.733 values Critical, Major, Minor, Warning and Indeterminate.
756
757 The detailed time stamps (raised, changed, cleared) which are essential for
758 synchronizing the alarm list using a query operation should be added to the
759 Doctor specification.
760
761 Other areas that need alignment is the so called alarm state in NFV. Here we must
762 however consider what can be attributes of the notification vs. what should be a
763 property of the alarm instance. This will be analyzed later.
764
765 .. _southbound:
766
767 Detailed southbound interface specification
768 -------------------------------------------
769
770 This section is specifying the southbound interfaces for fault management
771 between the Monitors and the Inspector.
772 Although southbound interfaces should be flexible to handle various events from
773 different types of Monitors, we define unified event API in order to improve
774 interoperability between the Monitors and the Inspector.
775 This is not limiting implementation of Monitor and Inspector as these could be
776 extended in order to support failures from intelligent inspection like prediction.
777
778 Note: The interface definition will be aligned with current work in ETSI NFV IFA
779 working group.
780
781 Fault event interface
782 ^^^^^^^^^^^^^^^^^^^^^
783
784 This interface allows the Monitors to notify the Inspector about an event which
785 was captured by the Monitor and may effect resources managed in the VIM.
786
787 EventNotification
788 _________________
789
790
791 Event notification including fault description.
792 The entity of this notification is event, and not fault or error specifically.
793 This allows us to use generic event format or framework build out of Doctor project.
794 The parameters below shall be mandatory, but keys in 'Details' can be optional.
795
796 Parameters:
797
798 * Time [1]: Datetime when the fault was observed in the Monitor.
799 * Type [1]: Type of event that will be used to process correlation in Inspector.
800 * Details [0..1]: Details containing additional information with Key-value pair style.
801   Keys shall be defined depending on the Type of the event.
802
803 E.g.:
804
805 .. code-block:: bash
806
807     {
808         'event': {
809             'time': '2016-04-12T08:00:00',
810             'type': 'compute.host.down',
811             'details': {
812                 'hostname': 'compute-1',
813                 'source': 'sample_monitor',
814                 'cause': 'link-down',
815                 'severity': 'critical',
816                 'status': 'down',
817                 'monitor_id': 'monitor-1',
818                 'monitor_event_id': '123',
819             }
820         }
821     }
822
823 Optional parameters in 'Details':
824
825 * Hostname: the hostname on which the event occurred.
826 * Source: the display name of reporter of this event. This is not limited to monitor, other entity can be specified such as 'KVM'.
827 * Cause: description of the cause of this event which could be different from the type of this event.
828 * Severity: the severity of this event set by the monitor.
829 * Status: the status of target object in which error occurred.
830 * MonitorID: the ID of the monitor sending this event.
831 * MonitorEventID: the ID of the event in the monitor. This can be used by operator while tracking the monitor log.
832 * RelatedTo: the array of IDs which related to this event.
833
834 Also, we can have bulk API to receive multiple events in a single HTTP POST
835 message by using the 'events' wrapper as follows:
836
837 .. code-block:: bash
838
839     {
840         'events': [
841             'event': {
842                 'time': '2016-04-12T08:00:00',
843                 'type': 'compute.host.down',
844                 'details': {},
845             },
846             'event': {
847                 'time': '2016-04-12T08:00:00',
848                 'type': 'compute.host.nic.error',
849                 'details': {},
850             }
851         ]
852     }
853
854
855
856
857 Blueprints
858 ----------
859
860 This section is listing a first set of blueprints that have been proposed by the
861 Doctor project to the open source community. Further blueprints addressing other
862 gaps identified in Section 4 will be submitted at a later stage of the OPNFV. In
863 this section the following definitions are used:
864
865 * "Event" is a message emitted by other OpenStack services such as Nova and
866   Neutron and is consumed by the "Notification Agents" in Ceilometer.
867 * "Notification" is a message generated by a "Notification Agent" in Ceilometer
868   based on an "event" and is delivered to the "Collectors" in Ceilometer that
869   store those notifications (as "sample") to the Ceilometer "Databases".
870
871 Instance State Notification  (Ceilometer) [*]_
872 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
873
874 The Doctor project is planning to handle "events" and "notifications" regarding
875 Resource Status; Instance State, Port State, Host State, etc. Currently,
876 Ceilometer already receives "events" to identify the state of those resources,
877 but it does not handle and store them yet. This is why we also need a new event
878 definition to capture those resource states from "events" created by other
879 services.
880
881 This BP proposes to add a new compute notification state to handle events from
882 an instance (server) from nova. It also creates a new meter "instance.state" in
883 OpenStack.
884
885 .. [*] https://etherpad.opnfv.org/p/doctor_bps
886
887 Event Publisher for Alarm  (Ceilometer) [*]_
888 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
889
890 **Problem statement:**
891
892   The existing "Alarm Evaluator" in OpenStack Ceilometer is periodically
893   querying/polling the databases in order to check all alarms independently from
894   other processes. This is adding additional delay to the fault notification
895   send to the Consumer, whereas one requirement of Doctor is to react on faults
896   as fast as possible.
897
898   The existing message flow is shown in :numref:`figure12`: after receiving
899   an "event", a "notification agent" (i.e. "event publisher") will send a
900   "notification" to a "Collector". The "collector" is collecting the
901   notifications and is updating the Ceilometer "Meter" database that is storing
902   information about the "sample" which is capured from original "event". The
903   "Alarm Evaluator" is periodically polling this databases then querying "Meter"
904   database based on each alarm configuration.
905
906   In the current Ceilometer implementation, there is no possibility to directly
907   trigger the "Alarm Evaluator" when a new "event" was received, but the "Alarm
908   Evaluator" will only find out that requires firing new notification to the
909   Consumer when polling the database.
910
911 **Change/feature request:**
912
913   This BP proposes to add a new "event publisher for alarm", which is bypassing
914   several steps in Ceilometer in order to avoid the polling-based approach of
915   the existing Alarm Evaluator that makes notification slow to users.
916
917   After receiving an "(alarm) event" by listening on the Ceilometer message
918   queue ("notification bus"), the new "event publisher for alarm" immediately
919   hands a "notification" about this event to a new Ceilometer component
920   "Notification-driven alarm evaluator" proposed in the other BP (see Section
921   5.6.3).
922
923   Note, the term "publisher" refers to an entity in the Ceilometer architecture
924   (it is a "notification agent"). It offers the capability to provide
925   notifications to other services outside of Ceilometer, but it is also used to
926   deliver notifications to other Ceilometer components (e.g. the "Collectors")
927   via the Ceilometer "notification bus".
928
929 **Implementation detail**
930
931   * "Event publisher for alarm" is part of Ceilometer
932   * The standard AMQP message queue is used with a new topic string.
933   * No new interfaces have to be added to Ceilometer.
934   * "Event publisher for Alarm" can be configured by the Administrator of
935     Ceilometer to be used as "Notification Agent" in addition to the existing
936     "Notifier"
937   * Existing alarm mechanisms of Ceilometer can be used allowing users to
938     configure how to distribute the "notifications" transformed from "events",
939     e.g. there is an option whether an ongoing alarm is re-issued or not
940     ("repeat_actions").
941
942 .. [*] https://etherpad.opnfv.org/p/doctor_bps
943
944 Notification-driven alarm evaluator (Ceilometer) [*]_
945 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
946
947 **Problem statement:**
948
949 The existing "Alarm Evaluator" in OpenStack Ceilometer is periodically
950 querying/polling the databases in order to check all alarms independently from
951 other processes. This is adding additional delay to the fault notification send
952 to the Consumer, whereas one requirement of Doctor is to react on faults as fast
953 as possible.
954
955 **Change/feature request:**
956
957 This BP is proposing to add an alternative "Notification-driven Alarm Evaluator"
958 for Ceilometer that is receiving "notifications" sent by the "Event Publisher
959 for Alarm" described in the other BP. Once this new "Notification-driven Alarm
960 Evaluator" received "notification", it finds the "alarm" configurations which
961 may relate to the "notification" by querying the "alarm" database with some keys
962 i.e. resource ID, then it will evaluate each alarm with the information in that
963 "notification".
964
965 After the alarm evaluation, it will perform the same way as the existing "alarm
966 evaluator" does for firing alarm notification to the Consumer. Similar to the
967 existing Alarm Evaluator, this new "Notification-driven Alarm Evaluator" is
968 aggregating and correlating different alarms which are then provided northbound
969 to the Consumer via the OpenStack "Alarm Notifier". The user/administrator can
970 register the alarm configuration via existing Ceilometer API [*]_. Thereby, he
971 can configure whether to set an alarm or not and where to send the alarms to.
972
973 **Implementation detail**
974
975 * The new "Notification-driven Alarm Evaluator" is part of Ceilometer.
976 * Most of the existing source code of the "Alarm Evaluator" can be re-used to
977   implement this BP
978 * No additional application logic is needed
979 * It will access the Ceilometer Databases just like the existing "Alarm
980   evaluator"
981 * Only the polling-based approach will be replaced by a listener for
982   "notifications" provided by the "Event Publisher for Alarm" on the Ceilometer
983   "notification bus".
984 * No new interfaces have to be added to Ceilometer.
985
986
987 .. [*] https://etherpad.opnfv.org/p/doctor_bps
988 .. [*] https://wiki.openstack.org/wiki/Ceilometer/Alerting
989
990 Report host fault to update server state immediately (Nova) [*]_
991 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
992
993 **Problem statement:**
994
995 * Nova state change for failed or unreachable host is slow and does not reliably
996   state host is down or not. This might cause same server instance to run twice
997   if action taken to evacuate instance to another host.
998 * Nova state for server(s) on failed host will not change, but remains active
999   and running. This gives the user false information about server state.
1000 * VIM northbound interface notification of host faults towards VNFM and NFVO
1001   should be in line with OpenStack state. This fault notification is a Telco
1002   requirement defined in ETSI and will be implemented by OPNFV Doctor project.
1003 * Openstack user cannot make HA actions fast and reliably by trusting server
1004   state and host state.
1005
1006 **Proposed change:**
1007
1008 There needs to be a new API for Admin to state host is down. This API is used to
1009 mark services running in host down to reflect the real situation.
1010
1011 Example on compute node is:
1012
1013 * When compute node is up and running:::
1014
1015     vm_state: activeand power_state: running
1016     nova-compute state: up status: enabled
1017
1018 * When compute node goes down and new API is called to state host is down:::
1019
1020     vm_state: stopped power_state: shutdown
1021     nova-compute state: down status: enabled
1022
1023 **Alternatives:**
1024
1025 There is no attractive alternative to detect all different host faults than to
1026 have an external tool to detect different host faults. For this kind of tool to
1027 exist there needs to be new API in Nova to report fault. Currently there must be
1028 some kind of workarounds implemented as cannot trust or get the states from
1029 OpenStack fast enough.
1030
1031 .. [*] https://blueprints.launchpad.net/nova/+spec/update-server-state-immediately
1032
1033 Other related BPs
1034 ^^^^^^^^^^^^^^^^^
1035
1036 This section lists some BPs related to Doctor, but proposed by drafters outside
1037 the OPNFV community.
1038
1039 pacemaker-servicegroup-driver [*]_
1040 __________________________________
1041
1042 This BP will detect and report host down quite fast to OpenStack. This however
1043 might not work properly for example when management network has some problem and
1044 host reported faulty while VM still running there. This might lead to launching
1045 same VM instance twice causing problems. Also NB IF message needs fault reason
1046 and for that the source needs to be a tool that detects different kind of faults
1047 as Doctor will be doing. Also this BP might need enhancement to change server
1048 and service states correctly.
1049
1050 .. [*] https://blueprints.launchpad.net/nova/+spec/pacemaker-servicegroup-driver