bp_synchronizer_design

Change-Id: I6cf25b98fcc93578dcfdd8752166845672207a63
This commit is contained in:
Nadav Yakar 2015-12-01 14:46:36 +00:00
parent 7e6f28c2c7
commit 2a9586b525
2 changed files with 211 additions and 286 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

View File

@ -4,206 +4,133 @@
http://creativecommons.org/licenses/by/3.0/legalcode http://creativecommons.org/licenses/by/3.0/legalcode
.. figure:: ./synchronizer_init.jpg
:width: 100%
:align: center
:alt: Architecture summary
============ ============
Synchronizer Synchronizer
============ ============
The synchronizer is a vitrage inner module which supplies both a snapshot (all the entities)
of openstack services via poll requests, or,
https://blueprints.launchpad.net/vitrage/+spec/synchronizer change notifications for entities which comprise the same OS services,
The synchronizer is a service which supplies both a snapshot(all the entities)
of openstack services (such as HEAT/NOVA/Cinder and so on) via poll requests,
or, change notifications for entities which comprise the same services,
via push notifications. via push notifications.
Each synchronizer instance has the capability of sampling any of these
openstack services at the same time, and vitrage might work against several
of these synchronizers for scaling purposes.
::
+------+ +------------------+
| | +-----------+ |
| +---------+---> Heat | |
| | | | Plugin | |
| | | +-----------+ |
| | | | | get all
| HEAT | | +--------+--+ | <---------------------------------------------------------------------------+-------------------+
| | | | Cinder | | | |
| | +----------> Plugin | Synchronizer| | |
| | | | +--------+--+ | | |
| | | | | | +----------------------------+ | Vitrage |
| | | | +--------+--+ | | | | |
+------+ | | | Nova | +-----------------------------> <-------------------------+ |
| +------> Plugin | | HEAT, Cinder, | | register for +-------------------+
+------+ | | | +--------+--+ | Nova, etc. | | change
| | | | | | | CRUD | | notifications
| | | | | +------------------+ notifications | | over entities
| | | | | | Queue | of a specific type
| | | | | +-----------------------+ | | (topic per type)
|Cinder| | | | | | | |
| | | | | +--------+--+ | | |
| | | | +---> Heat | +------------------------> |
| | | | | Plugin | | HEAT, Cinder, | |
| +--+ | +--------+--+ | Nova, etc. | |
+------+ | | | | CRUD +----------------------------+
| | +--------+--+ | notifications
+------+ | | | Cinder | Synchronizer |
| | +----------> Plugin | |
| | | +--------+--+ |
| | | | |
| Nova | | +--------+--+ |
| +------+------> Nova | |
| | | Plugin | |
| | +--------+--+ |
+------+ | |
+-----------------------+
Alternative diagram
::
+-------------+
+----------+ +--------------+ get all response | |
| entity | | +------------------------------------------------> |
+------+ type x <---------------+ <-----------------------------------------------+ Vitrage |
| | | polling via | | get all request +----------+ | graph |
+-----------------------------+ | +----------+ api or via | | | queue | | |
| Openstack services: | | message | Synchronizer | | | +-------------+
| Keystone, Nova, <----+ +----------+ queue | <------------------------------+ ^ |
| Neutron, Glance, | | entity | | | register for change +----------+
| Cinder, Heat <-----------+ type y <---------------+ | notifications over |
| | | | | | entities of a specific |
| other polling mechanisms: | +----------+ | | type |
| Nagios <----+ | | |
| Ceilometer | | +----------+ | | entity changes |
| | | | entity | | +------------------------------------+
| | +------+ type z <---------------+ |
| | | | +--------------+
+-----------------------------+ +----------+
Problem description Problem description
=================== ===================
Enable Vitrage and to maintain the most up-to-date view of OS services it samples. Enable vitrage and to maintain the most up-to-date view of OS services, Nagios, etc., it samples.
Proposed change Proposed change
=============== ===============
periodically samples OS services, Nagios, etc., and produces up to date entities once changed (in contrast to deltas)
periodically samples OS services and produces up to date entities once changed (in contrast to deltas)
design design
------ ------
northbound interface interacting with the module
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
get all get all notifications
""""""" """""""""""""""""""""
- list of entity types
- return the whole latest snapshot
- through polling
- using RPC
- interface signature - **TBD**
change notifications change notifications
"""""""""""""""""""" """"""""""""""""""""
- registration:
- interface signature - **TBD** supply a list of entity types and a callback function for the synchronizer to invoke for sending information back concurrent immediate execution (a call for this function is would not block the caller)done by the vitrage graph manager
- push notifications - push notifications
- sent to:
- openstack message bus (if installed on openstack)
- or to a queue (which would be installed as part of the synchronizer deployment)
southbound interface synchronizers response
""""""""""""""""""""""
- either list-all and notifications response contains entities
- each entity must contain:keyparent/child keytypetimestamp?CRUD action (new entity/updated/...)state (active/shutdown/…)project (role)
synchronizer plugins
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
kinds of plugins:
Message bus plugin
""""""""""""""""""
- register for message bus notifications via the oslo-messaging library
Collector plugin
""""""""""""""""
:: ::
+ +-------------------------------------------------------------------------------------------------+
^ | | |
| | | vitrage graph ^ ^ |
| | | |
+-------------------------------------------------------------------------------------------------+
| |
+------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------+
| | synchronizer | | | | synchronizer | |
| | |get all | | | | |
| | | | | | | |
| | | | | +--------+-----------------------+ collect +-------+------------+ |
| | +-----v-----+ | | | | notifications | | |
| | | subprocess| | | | worker +---+-------------+ | worker | |
| | | | | | | | | | | | |
| | | | | | +--------------------------------+ | | +------------------+-+ |
| | notification | | | | notification | | collect | |
| | +---+-------+ | | | | notifications| |
| | | | | | | | |
| +----------------------|-----------------------------|-------+ +-----------+ +------------+ | | +------------------------------------------------------------+ +v----------+ +------------+ |
| | | plugin | | | plugin | | plugin | | | | collector plugin | | | msg bus | | msg bus| | |
| | | | | | | | | | | | | | | plugin | | plugin v | |
| | | | | | | | | | | | | | | | | | |
| | +--------------------+-------------------------+ |get | | | | | | | | | | | | | | |
| | | | |all | | | | | | | | | | | | | | |
| | | subprocess | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | |
| | | +----------------------------+ | | | | | | | | | | +----------------------------+ | | | | | | |
| | | baseline:|hash0|hash1|hash2|hash3|... | | | | | | | | | | | baseline:|hash0|hash1|hash2|hash3|... | <-----+ | | | | | |
| | | +----------^-----------------+ | | | | | | | | | | +----------^-----------------+ | | | | | | |
| | | |if | | | | | | | | | | |if | | | | | | |
| | | |hash(item)!=hash1 ==> | | | | | | | | | | |hash(item)!=hash1 ==> | | | | | | |
| | | |propagate item as a | | | | | | | | | | |propagate item as a | | | | | | |
| | | |change notification | | | | | | | | | | |change notification | | | | | | |
| | | | | | | | | | | | | | | | | | | | | |
| | | +-----------+---------------+ | | | | | | | | | | +-----------+---------------+ | | | | | | |
| | | |sampling worker (one/more?)| | | | | | | | | | | |sampling ^ <------------+ | | | | | |
| | | +----------^----------------+ | | | | | | | | | | +----------|----------------+ | | | | | |
| | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | |
| | +---------------------|------------------------+ | | | | | | | | | | | | | | | |
| | | | | | | | | | | +------------------------------------------------------------+ +-----------+ +------------+ |
| +-----------------------|----------------------------|-------+ +-----------+ +------------+ | | | |
| | | | +------------------------------------------------------------------------------------------------+
+-------------------------|----------------------------|-----------------------------------------+ |
| | +-----------+-------------------+
+-----------+-------------------+ | | OS service |
| OS service | |
| <--------+
+-------------------------------+ +-------------------------------+
- sampling of OS services - samples OS services, Nagios, etc.
- via each OS service REST API - via each OS service REST API
- method of collection: - method of collection:
- retrieve OS service elements list. For the purposes of: retrieve OS service elements list. For the purposes of:change notifications - as part of the periodic collection of the latest snapshotwe'd use this method of collection against OS services which doesn't propagates change notification.run on its own collection subprocesses how to discover a changeonce a snapshot is collected, we'd like to know which entity was changed from the latest time a snapshot was takenin order to enable this, we'd keep a baseline - a data structure which contains for each OS service entity (such as a vm instance), its ID + it latest collection timestamp or a hash which represents its latests state.by comparing the latest snapshot of elements against the baseline, we'd know for which entity we'd like to propagate a notification for.collect deltas for services which reveals this functionalityfor the purposes of change notificationsthis is the easy case, where change notifications are simply passed on to whoever registered for them
- 'get all' - as a response for a 'get all' northbound interface call
- run on its own subprocess, separated from the collecting sub processes (cont.)
- change notifications - as part of the periodic collection of the latest snapshot
- we'd use this method of collection against OS services which doesn't propagates change notification.
- run on its own collection sub processes (**one/more? - TBD**)
- how to discover a change
- once a snapshot is collected, we'd like to know which entity was changed from the latest time a snapshot was taken
- in order to enable this, we'd keep a baseline - a data structure which contains for each OS service entity (such as a vm instance), its ID + it latest collection timestamp or a hash which represents its latests state.
- by comparing the latest snapshot of elements against the baseline, we'd know for which entity we'd like to propagate a notification for.
- collect deltas for services which reveals this functionality
- for the purposes of change notifications
- this is the easy case, where change notifications are simply passed on to whoever registered for them
- type of collection:
- against each OS service we'd like to sample, a plugin library would enable BOTH the collection sub processes and the 'get all' method to retrieve BOTH a complete snapshot of the OS service (all the VM instances / all of the ports / etc.) AND to sample for change notifications, as described above.
- deployment - as a library - deployment - as a library
consumer flow consumer flow
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
- 'get all' - for a complete snapshot of OS services, the consumer would call the 'get all' interface - new plugin:
- 'change notification' - for a streaming change notifications, the consumer would normally: write my_plugin.py:
- register for change notifications against the queue my_plugin(synchronizer.BasePlugin): ...
- then immediately call the 'get all' interface to have the latest snapshot register my_plugin class path in conf file
- over time, exercise each notification which was sampled after this snapshot, over it, in order to have the latest view of the OS services install an egg which contains a my_plugin.py
restart vitrage service
- initial configuration:
- configure nova, heat, etc. to send message bus notifications for vitrage too (consumption of msg bus notification by the listener removes it from the queue)
- configure active entity types
- configure message bus credentials for the msg bus listener
- configure nagios credentials
- register for 'change notification' - for a streaming change notifications, upon synchronizer initialization, the consumer would supply the queue on which the notifications would be returned to upon synchronizer initialization which would spawn subprocesses which would call the 'get all' periodically in order to supply the graph with the latest snapshot.
Alternatives Alternatives
------------ ------------
@ -228,9 +155,7 @@ Versioning impact
Other end user impact Other end user impact
--------------------- ---------------------
- 'get all' - **TBD** None
- 'change notification' - **TBD**
Deployer impact Deployer impact
--------------- ---------------