The Vitrage Scenario Evaluator is charged with the evaluation of the scenarios specified in the Vitrage templates, and executing the actions associated with these scenarios when they are triggered. The Scenario Evaluator is also responsible for resolving any inter-action dependencies, such as two contradicting actions (e.g., raise and disable the same alarm), two overlapping actions etc.
+-------------+
| +-------------+
| | |
| | Templates |
+-+ (YAML) |
+-----------+-+
|
+------------------------------------------------------------------------------+
|Template | |
|Loading | load |
| | |
| +-----v-------------+ +---------------+ +---------------+ |
| | Template Data | | | | | |
| | |process | Template | add | Scenario | |
| |(Python Dictionary)+--------> Object +-------> Repo | |
| | | | | | | |
| +-------------------+ +---------------+ +---+--------+--+ |
| | ^ |
| | | |
| | | |
+------------------------------------------------------------------------------+
| |
+-----------------------------------------------------------------------------------+
| Event Processing return relevant| | get |
| scenarios | | scenarios |
| +--------------+ +----------------------------------+ |
| | | perform | analyze | | | |
| | Action | action | matches | | | |
| | Executor <--------------------------------+ | | | |
| | | | | | | | |
| | | | | | | | |
| +--------------+ +----------------------------------+ |
| | | | |
| return scenario | | | |
| matches | | | |
| +-----+------v--------+ |
| | | |
| | Entity Graph | |
| | | |
| | | |
| +---------------------+ |
+-----------------------------------------------------------------------------------+
Scenarios are written up in configuration files called templates. The format and specification of these can be seen here.
Templates should all be located in the <vitrage folder>/templates folder.
When Vitrage is started up, all the templates are loaded into a Scenario Repository. During this loading, template verification is done to ensure the correct format is used, references are valid, and more. Errors in each template should be written to the log. Invalid templates are skipped. See details.
The Scenario Repository supports querying for scenarios based on a vertex or edge in the Entity Graph. Given such a graph element, the Scenario Repository will return all scenarios where this element appears in the scenario condition. This means that a corresponding element appears in the scenario condition, such that for each key-value in the template, the same key-value can be found in the element (but not always the reverse).
During the initialization of Vitrage, the Scenario Evaluator will be de-activated until all the datasources complete their initial “get_all” process. After it is activated, the consistency flow will begin, which will trigger all the relevant scenarios for each element in the Entity Graph.
This approach has several benefits:
It is possible that this late activation of the evaluator will be removed or changed once we move to a persistent graph database for the Entity Graph in future version.
There can be multiple Vitrage scenarios loaded in a specific system, some of which might overlap in their targets. For example, two scenarios might have a “set_state” action, with identical or different states, for the same resource. We need to deal with such overlaps. Currently, the goal is to support overlap of the same action type with itself, specifically the following use cases, which correspond to the three actions Vitrage supports at this point:
For all of these, the desired behavior is to choose the dominant outcome or action. For set_state this means the worst state, and for raise_alarm this means the highest severity of all active actions.
In order to support this feature, Vitrage maintains an in-memory record of all active actions, indexed (broadly) according to their affected target. This allows for tracking individual actions and their triggers, even when they overlap in their effect.
For more details on the implementation of this functionality, see the design on this etherpad.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.