Add agent property: resources-synced

Agents supporting the guaranteed minimum bandwidth feature need to share
their resource view with neutron-server and in turn with Placement. The
success of this synchronization represented by the agent attribute
resources-synced.

Change-Id: I764a50884d8f23bbcad25825676c897107ed8f3f
Depends-On: https://review.openstack.org/630999
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
This commit is contained in:
Lajos Katona 2019-02-06 12:42:03 +01:00 committed by Slawek Kaplonski
parent a185a7fd2d
commit 2742e28ee4
2 changed files with 11 additions and 0 deletions

View File

@ -57,6 +57,15 @@ class Agent(resource.Resource):
#: Whether or not the network agent is alive.
#: *Type: bool*
is_alive = resource.Body('alive', type=bool)
#: Whether or not the agent is succesffully synced towards placement.
#: Agents supporting the guaranteed minimum bandwidth feature share their
#: resource view with neutron-server and neutron-server share this view
#: with placement, resources_synced represents the success of the latter.
#: The value None means no resource view synchronization to Placement was
#: attempted. true / false values signify the success of the last
#: synchronization attempt.
#: *Type: bool*
resources_synced = resource.Body('resources_synced', type=bool)
#: Timestamp when the network agent was last started.
started_at = resource.Body('started_at')
#: The messaging queue topic the network agent subscribes to.

View File

@ -28,6 +28,7 @@ EXAMPLE = {
'heartbeat_timestamp': '2016-08-09T12:14:57.233772',
'host': 'test-host',
'id': IDENTIFIER,
'resources_synced': False,
'started_at': '2016-07-09T12:14:57.233772',
'topic': 'test-topic',
'ha_state': 'active'
@ -61,6 +62,7 @@ class TestAgent(base.TestCase):
self.assertEqual(EXAMPLE['heartbeat_timestamp'], sot.last_heartbeat_at)
self.assertEqual(EXAMPLE['host'], sot.host)
self.assertEqual(EXAMPLE['id'], sot.id)
self.assertEqual(EXAMPLE['resources_synced'], sot.resources_synced)
self.assertEqual(EXAMPLE['started_at'], sot.started_at)
self.assertEqual(EXAMPLE['topic'], sot.topic)
self.assertEqual(EXAMPLE['ha_state'], sot.ha_state)