bp_synchronizer_design
Change-Id: I6cf25b98fcc93578dcfdd8752166845672207a63
This commit is contained in:
parent
7e6f28c2c7
commit
2a9586b525
BIN
specs/mitaka/synchronizer_init.jpg
Normal file
BIN
specs/mitaka/synchronizer_init.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 246 KiB |
@ -1,286 +1,211 @@
|
|||||||
..
|
..
|
||||||
This work is licensed under a Creative Commons Attribution 3.0 Unported
|
This work is licensed under a Creative Commons Attribution 3.0 Unported
|
||||||
License.
|
License.
|
||||||
|
|
||||||
http://creativecommons.org/licenses/by/3.0/legalcode
|
http://creativecommons.org/licenses/by/3.0/legalcode
|
||||||
|
|
||||||
============
|
.. figure:: ./synchronizer_init.jpg
|
||||||
Synchronizer
|
:width: 100%
|
||||||
============
|
:align: center
|
||||||
|
:alt: Architecture summary
|
||||||
|
|
||||||
https://blueprints.launchpad.net/vitrage/+spec/synchronizer
|
============
|
||||||
|
Synchronizer
|
||||||
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,
|
The synchronizer is a vitrage inner module which supplies both a snapshot (all the entities)
|
||||||
or, change notifications for entities which comprise the same services,
|
of openstack services via poll requests, or,
|
||||||
via push notifications.
|
change notifications for entities which comprise the same OS services,
|
||||||
Each synchronizer instance has the capability of sampling any of these
|
via push notifications.
|
||||||
openstack services at the same time, and vitrage might work against several
|
|
||||||
of these synchronizers for scaling purposes.
|
Problem description
|
||||||
|
===================
|
||||||
::
|
|
||||||
|
Enable vitrage and to maintain the most up-to-date view of OS services, Nagios, etc., it samples.
|
||||||
+------+ +------------------+
|
|
||||||
| | +-----------+ |
|
Proposed change
|
||||||
| +---------+---> Heat | |
|
===============
|
||||||
| | | | Plugin | |
|
periodically samples OS services, Nagios, etc., and produces up to date entities once changed (in contrast to deltas)
|
||||||
| | | +-----------+ |
|
|
||||||
| | | | | get all
|
design
|
||||||
| HEAT | | +--------+--+ | <---------------------------------------------------------------------------+-------------------+
|
------
|
||||||
| | | | Cinder | | | |
|
|
||||||
| | +----------> Plugin | Synchronizer| | |
|
interacting with the module
|
||||||
| | | | +--------+--+ | | |
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
| | | | | | +----------------------------+ | Vitrage |
|
|
||||||
| | | | +--------+--+ | | | | |
|
get all notifications
|
||||||
+------+ | | | Nova | +-----------------------------> <-------------------------+ |
|
"""""""""""""""""""""
|
||||||
| +------> Plugin | | HEAT, Cinder, | | register for +-------------------+
|
- list of entity types
|
||||||
+------+ | | | +--------+--+ | Nova, etc. | | change
|
|
||||||
| | | | | | | CRUD | | notifications
|
change notifications
|
||||||
| | | | | +------------------+ notifications | | over entities
|
""""""""""""""""""""
|
||||||
| | | | | | Queue | of a specific type
|
- registration:
|
||||||
| | | | | +-----------------------+ | | (topic per type)
|
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
|
||||||
|Cinder| | | | | | | |
|
- push notifications
|
||||||
| | | | | +--------+--+ | | |
|
|
||||||
| | | | +---> Heat | +------------------------> |
|
synchronizers response
|
||||||
| | | | | Plugin | | HEAT, Cinder, | |
|
""""""""""""""""""""""
|
||||||
| +--+ | +--------+--+ | Nova, etc. | |
|
- either list-all and notifications response contains entities
|
||||||
+------+ | | | | CRUD +----------------------------+
|
- each entity must contain:keyparent/child keytypetimestamp?CRUD action (new entity/updated/...)state (active/shutdown/…)project (role)
|
||||||
| | +--------+--+ | notifications
|
|
||||||
+------+ | | | Cinder | Synchronizer |
|
synchronizer plugins
|
||||||
| | +----------> Plugin | |
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
| | | +--------+--+ |
|
kinds of plugins:
|
||||||
| | | | |
|
|
||||||
| Nova | | +--------+--+ |
|
Message bus plugin
|
||||||
| +------+------> Nova | |
|
""""""""""""""""""
|
||||||
| | | Plugin | |
|
- register for message bus notifications via the oslo-messaging library
|
||||||
| | +--------+--+ |
|
|
||||||
+------+ | |
|
Collector plugin
|
||||||
+-----------------------+
|
""""""""""""""""
|
||||||
|
|
||||||
|
|
||||||
Alternative diagram
|
::
|
||||||
|
|
||||||
::
|
+-------------------------------------------------------------------------------------------------+
|
||||||
|
| |
|
||||||
|
| vitrage graph ^ ^ |
|
||||||
+-------------+
|
| | | |
|
||||||
+----------+ +--------------+ get all response | |
|
+-------------------------------------------------------------------------------------------------+
|
||||||
| entity | | +------------------------------------------------> |
|
| |
|
||||||
+------+ type x <---------------+ <-----------------------------------------------+ Vitrage |
|
+------------------------------------------------------------------------------------------------+
|
||||||
| | | polling via | | get all request +----------+ | graph |
|
| | synchronizer | |
|
||||||
+-----------------------------+ | +----------+ api or via | | | queue | | |
|
| | | |
|
||||||
| Openstack services: | | message | Synchronizer | | | +-------------+
|
| | | |
|
||||||
| Keystone, Nova, <----+ +----------+ queue | <------------------------------+ ^ |
|
| +--------+-----------------------+ collect +-------+------------+ |
|
||||||
| Neutron, Glance, | | entity | | | register for change +----------+
|
| | | notifications | | |
|
||||||
| Cinder, Heat <-----------+ type y <---------------+ | notifications over |
|
| | worker +---+-------------+ | worker | |
|
||||||
| | | | | | entities of a specific |
|
| | | | | | | |
|
||||||
| other polling mechanisms: | +----------+ | | type |
|
| +--------------------------------+ | | +------------------+-+ |
|
||||||
| Nagios <----+ | | |
|
| notification | | collect | |
|
||||||
| Ceilometer | | +----------+ | | entity changes |
|
| | | notifications| |
|
||||||
| | | | entity | | +------------------------------------+
|
| | | | |
|
||||||
| | +------+ type z <---------------+ |
|
| +------------------------------------------------------------+ +v----------+ +------------+ |
|
||||||
| | | | +--------------+
|
| | collector plugin | | | msg bus | | msg bus| | |
|
||||||
+-----------------------------+ +----------+
|
| | | | | plugin | | plugin v | |
|
||||||
|
| | | | | | | | |
|
||||||
|
| | | | | | | | |
|
||||||
|
| | | | | | | | |
|
||||||
|
| | | | | | | | |
|
||||||
|
| | | | | | | | |
|
||||||
|
| | | | | | | | |
|
||||||
Problem description
|
| | +----------------------------+ | | | | | | |
|
||||||
===================
|
| | baseline:|hash0|hash1|hash2|hash3|... | <-----+ | | | | | |
|
||||||
|
| | +----------^-----------------+ | | | | | | |
|
||||||
Enable Vitrage and to maintain the most up-to-date view of OS services it samples.
|
| | |if | | | | | | |
|
||||||
|
| | |hash(item)!=hash1 ==> | | | | | | |
|
||||||
Proposed change
|
| | |propagate item as a | | | | | | |
|
||||||
===============
|
| | |change notification | | | | | | |
|
||||||
|
| | | | | | | | | |
|
||||||
periodically samples OS services and produces up to date entities once changed (in contrast to deltas)
|
| | +-----------+---------------+ | | | | | | |
|
||||||
|
| | |sampling ^ <------------+ | | | | | |
|
||||||
|
| | +----------|----------------+ | | | | | |
|
||||||
|
| | | | | | | | |
|
||||||
design
|
| | | | | | | |
|
||||||
------
|
| | | | | | | | |
|
||||||
|
| +------------------------------------------------------------+ +-----------+ +------------+ |
|
||||||
northbound interface
|
| | |
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
+------------------------------------------------------------------------------------------------+
|
||||||
|
|
|
||||||
get all
|
+-----------+-------------------+
|
||||||
"""""""
|
| OS service |
|
||||||
|
+-------------------------------+
|
||||||
- return the whole latest snapshot
|
|
||||||
- through polling
|
- samples OS services, Nagios, etc.
|
||||||
- using RPC
|
- via each OS service REST API
|
||||||
- interface signature - **TBD**
|
- method of collection:
|
||||||
|
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
|
||||||
change notifications
|
- deployment - as a library
|
||||||
""""""""""""""""""""
|
|
||||||
|
consumer flow
|
||||||
- interface signature - **TBD**
|
^^^^^^^^^^^^^
|
||||||
- push notifications
|
- new plugin:
|
||||||
- sent to:
|
write my_plugin.py:
|
||||||
- openstack message bus (if installed on openstack)
|
my_plugin(synchronizer.BasePlugin): ...
|
||||||
- or to a queue (which would be installed as part of the synchronizer deployment)
|
register my_plugin class path in conf file
|
||||||
|
install an egg which contains a my_plugin.py
|
||||||
southbound interface
|
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.
|
||||||
+------------------------------------------------------------------------------------------------+
|
|
||||||
| | synchronizer | |
|
Alternatives
|
||||||
| | |get all |
|
------------
|
||||||
| | | |
|
|
||||||
| | | |
|
None
|
||||||
| | +-----v-----+ |
|
|
||||||
| | | subprocess| |
|
Data model impact
|
||||||
| | | | |
|
-----------------
|
||||||
| | | | |
|
|
||||||
| | notification | | |
|
**TBD**
|
||||||
| | +---+-------+ |
|
|
||||||
| | | |
|
REST API impact
|
||||||
| +----------------------|-----------------------------|-------+ +-----------+ +------------+ |
|
---------------
|
||||||
| | | plugin | | | plugin | | plugin | |
|
|
||||||
| | | | | | | | | |
|
**TBD**
|
||||||
| | | | | | | | | |
|
|
||||||
| | +--------------------+-------------------------+ |get | | | | | |
|
Versioning impact
|
||||||
| | | | |all | | | | | |
|
-----------------
|
||||||
| | | subprocess | | | | | | | |
|
|
||||||
| | | | | | | | | | |
|
**TBD**
|
||||||
| | | | | | | | | | |
|
|
||||||
| | | +----------------------------+ | | | | | | | |
|
Other end user impact
|
||||||
| | | baseline:|hash0|hash1|hash2|hash3|... | | | | | | | | |
|
---------------------
|
||||||
| | | +----------^-----------------+ | | | | | | | |
|
|
||||||
| | | |if | | | | | | | |
|
None
|
||||||
| | | |hash(item)!=hash1 ==> | | | | | | | |
|
|
||||||
| | | |propagate item as a | | | | | | | |
|
Deployer impact
|
||||||
| | | |change notification | | | | | | | |
|
---------------
|
||||||
| | | | | | | | | | | |
|
|
||||||
| | | +-----------+---------------+ | | | | | | | |
|
**TBD**
|
||||||
| | | |sampling worker (one/more?)| | | | | | | | |
|
|
||||||
| | | +----------^----------------+ | | | | | | | |
|
Developer impact
|
||||||
| | | | | | | | | | | |
|
----------------
|
||||||
| | | | | | | | | | | |
|
|
||||||
| | +---------------------|------------------------+ | | | | | | |
|
**TBD**
|
||||||
| | | | | | | | | |
|
|
||||||
| +-----------------------|----------------------------|-------+ +-----------+ +------------+ |
|
Horizon impact
|
||||||
| | | |
|
--------------
|
||||||
+-------------------------|----------------------------|-----------------------------------------+
|
|
||||||
| |
|
None
|
||||||
+-----------+-------------------+ |
|
|
||||||
| OS service | |
|
|
||||||
| <--------+
|
Implementation
|
||||||
+-------------------------------+
|
==============
|
||||||
|
|
||||||
- sampling of OS services
|
Assignee(s)
|
||||||
- via each OS service REST API
|
-----------
|
||||||
- method of collection:
|
|
||||||
- retrieve OS service elements list. For the purposes of:
|
**TBD**
|
||||||
- 'get all' - as a response for a 'get all' northbound interface call
|
|
||||||
- run on its own subprocess, separated from the collecting sub processes (cont.)
|
Work Items
|
||||||
- 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**)
|
**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.
|
Dependencies
|
||||||
- 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
|
**TBD**
|
||||||
- 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.
|
Testing
|
||||||
- deployment - as a library
|
=======
|
||||||
|
Unit Tests - Tox
|
||||||
consumer flow
|
Integration Tests - Tempest
|
||||||
^^^^^^^^^^^^^
|
|
||||||
- 'get all' - for a complete snapshot of OS services, the consumer would call the 'get all' interface
|
|
||||||
- 'change notification' - for a streaming change notifications, the consumer would normally:
|
Documentation Impact
|
||||||
- register for change notifications against the queue
|
====================
|
||||||
- then immediately call the 'get all' interface to have the latest snapshot
|
|
||||||
- over time, exercise each notification which was sampled after this snapshot, over it, in order to have the latest view of the OS services
|
**TBD**
|
||||||
|
|
||||||
|
|
||||||
Alternatives
|
References
|
||||||
------------
|
==========
|
||||||
|
|
||||||
None
|
**TBD**
|
||||||
|
|
||||||
Data model impact
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
REST API impact
|
|
||||||
---------------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
Versioning impact
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
Other end user impact
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
- 'get all' - **TBD**
|
|
||||||
- 'change notification' - **TBD**
|
|
||||||
|
|
||||||
|
|
||||||
Deployer impact
|
|
||||||
---------------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
Developer impact
|
|
||||||
----------------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
Horizon impact
|
|
||||||
--------------
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
|
|
||||||
Implementation
|
|
||||||
==============
|
|
||||||
|
|
||||||
Assignee(s)
|
|
||||||
-----------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
Work Items
|
|
||||||
----------
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
============
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
|
|
||||||
Testing
|
|
||||||
=======
|
|
||||||
Unit Tests - Tox
|
|
||||||
Integration Tests - Tempest
|
|
||||||
|
|
||||||
|
|
||||||
Documentation Impact
|
|
||||||
====================
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
|
||||||
|
|
||||||
References
|
|
||||||
==========
|
|
||||||
|
|
||||||
**TBD**
|
|
||||||
|
Loading…
Reference in New Issue
Block a user