vitrage/doc/source/notifier-aodh-plugin.rst
Tovin Seven e2b21d516d Beautify, correct URLs in documentation files
- Beautify, re-indent, format code in a lot of doc files
- Use relative URLs instead of absolute github URLs
- Some absolute github urls are not corrected yet:
    + URL for enabling vitrage in devstack
    + URL for enabling vitrage in horizon
- Update year number in doc/source/config.py from 2013 to 2016

My thought: We should have a blueprint
    to create more concise and easy to access like other project
    (nova: http://docs.openstack.org/developer/nova/).
    Currently, that site for vitrage has not existed yet.

Notes: Change github URLs to relative URLs
    (or absolute URLs in docs.openstack.org/developers)
    will not work correctly
    if we do not have official documentation site.
    Hence, other people cannot follow the link to html page
    if they read vitrage documentation in github mirror.

Change-Id: Ifff8355c7e5291f68a7592d1617644053d790d5e
2016-11-18 04:34:55 +00:00

4.1 KiB

Vitrage Notifier plugins - AODH

Overview

The Evaluator performs root cause analysis on the Vitrage Graph and may determine that an alarm should be created, deleted or otherwise updated.

Other components are notified of such changes by the Vitrage Notifier service. Among others, Vitrage Notifier is responsible for handling Aodh Alarms.

This document describes the implementation of Vitrage Notifier infrastructure and specifically notifying Aodh on Vitrage alarms.

Design

+----------+  +-----------+   +------+         +--------+
| Vitrage  |  | DataSource|   |Graph |         | Message|       +------------------+
| Evaluator|->| Queue     |-->|      |-------->|  Bus   |------>| Vitrage Notifier |
+----------+  +-----------+   +------+         |        |       +------------------+
                                               |        |          |        |   |
                                               |        |      +----------+ |   |
                                               |        |      | Aodh     |---+ |
                                               |        |      | notifier |   |----+
                                               |        |   +--| plugin   |   |    |
                                               |        |   |  +----------+   |    |
                                               +--------+   |     +-----------+    |
                                                            |         +------------+
                 +------------------+                       |
                 |   Aodh           |<----------------------+
                 +------------------+

...

DeducedAlarmNotifier class will be subscribed to entity graph notifications. Whenever a vitrage deduced alarm is added to the graph it will post a message to the message bus. The processor will hold an instance of the DeducedAlarmNotifier class and will subscribe this instance to entity graph notifications.

The VitrageNotifier is a new service that listens to the bus for internal vitrage notifications, then can call all the relevant notifier plugins.

  1. Deduced Alarm created by the Evaluator
  2. Graph vertex added/updated
  3. DeducedAlarmNotifier writes to message bus
  4. VitrageNotifierService receives the event and calls all plugins
  5. Aodh plugin - using the ceilometer client, creates an event in aodh (with some metadata params in the query)

Deduced Alarms bus notifications

Vitrage Evaluator will create a deduced alarm, sending it to the data source queue Vitrage Evaluator will use the vitrage.graph message bus topic, and will post messages as follows:

  • message of type vitrage.deduced_alarm.activate :
    • name - is the alarm name in vitrage
    • severity - is the alarm severity
    • affected_resource_id - is the openstack id of the resource on which the alarm was raised
  • vitrage.deduced_alarm.deactivate
    • id - is the alarm id

Notifier

  • Is a new running service
  • Receives notifications from the message bus
  • Holds instances of all the plugins
  • Upon a received notification, calls 'notify(msg)' for all the plugins
  • Each plugin is responsible of how and whether to process the notification

Aodh Plugin

Vitrage alarms should be reflected as possible in Aodh. The aodh plugin has ceilometer client by which it can send rest calls to aodh

Handle vitrage.deduced_alarm.activate

Create an event alarm with the specified severity, where the alarm name is vitrage_alarm_name+resource_id so to be unique

  • Message does not contain aodh alarm id:
    • plugin will create a new aodh alarm
    • alarm type - event
    • alarm status - alarm
    • query contain resource_id, vitrage_id fields
  • Message contains aodh alarm id
    • plugin will update the aodh alarm status to alarm

Handle vitrage.deduced_alarm.deactivate

Delete an event alarm with the specified id

  • message will contain the aodh alarm id - plugin will update the alarm status to ok