diff --git a/doc/notification_samples/common_payloads/InstanceNUMACellPayload.json b/doc/notification_samples/common_payloads/InstanceNUMACellPayload.json index 9dcad38d08..4ea2df6a50 100644 --- a/doc/notification_samples/common_payloads/InstanceNUMACellPayload.json +++ b/doc/notification_samples/common_payloads/InstanceNUMACellPayload.json @@ -1,5 +1,5 @@ { - "nova_object.version": "1.0", + "nova_object.version": "1.1", "nova_object.namespace": "nova", "nova_object.name": "InstanceNUMACellPayload", "nova_object.data": { @@ -8,6 +8,7 @@ "cpu_thread_policy": null, "cpu_topology": null, "cpuset": [0], + "pcpuset": [], "cpuset_reserved": null, "id": 0, "memory": 512, diff --git a/nova/notifications/objects/request_spec.py b/nova/notifications/objects/request_spec.py index 28ca6baf04..7ef6be1124 100644 --- a/nova/notifications/objects/request_spec.py +++ b/nova/notifications/objects/request_spec.py @@ -143,22 +143,26 @@ class InstanceNUMATopologyPayload(base.NotificationPayloadBase): @nova_base.NovaObjectRegistry.register_notification class InstanceNUMACellPayload(base.NotificationPayloadBase): # Version 1.0: Initial version - VERSION = '1.0' + # Version 1.1: Added pcpuset field + VERSION = '1.1' SCHEMA = { 'id': ('numa_cell', 'id'), 'cpuset': ('numa_cell', 'cpuset'), + 'pcpuset': ('numa_cell', 'pcpuset'), + 'cpuset_reserved': ('numa_cell', 'cpuset_reserved'), 'memory': ('numa_cell', 'memory'), 'pagesize': ('numa_cell', 'pagesize'), 'cpu_pinning_raw': ('numa_cell', 'cpu_pinning_raw'), 'cpu_policy': ('numa_cell', 'cpu_policy'), 'cpu_thread_policy': ('numa_cell', 'cpu_thread_policy'), - 'cpuset_reserved': ('numa_cell', 'cpuset_reserved'), } fields = { 'id': fields.IntegerField(), 'cpuset': fields.SetOfIntegersField(), + 'pcpuset': fields.SetOfIntegersField(), + 'cpuset_reserved': fields.SetOfIntegersField(nullable=True), 'memory': fields.IntegerField(), 'pagesize': fields.IntegerField(nullable=True), 'cpu_topology': fields.ObjectField('VirtCPUTopologyPayload', @@ -167,7 +171,6 @@ class InstanceNUMACellPayload(base.NotificationPayloadBase): 'cpu_policy': fields.CPUAllocationPolicyField(nullable=True), 'cpu_thread_policy': fields.CPUThreadAllocationPolicyField( nullable=True), - 'cpuset_reserved': fields.SetOfIntegersField(nullable=True) } def __init__(self, numa_cell): diff --git a/nova/tests/unit/notifications/objects/test_notification.py b/nova/tests/unit/notifications/objects/test_notification.py index f3b91ef21e..07d3ba3349 100644 --- a/nova/tests/unit/notifications/objects/test_notification.py +++ b/nova/tests/unit/notifications/objects/test_notification.py @@ -411,7 +411,7 @@ notification_object_data = { 'InstanceActionSnapshotPayload': '1.9-c3e0bbaaefafdfa2f8e6e504c2c9b12c', 'InstanceExistsNotification': '1.0-a73147b93b520ff0061865849d3dfa56', 'InstanceExistsPayload': '1.2-e082c02438ee57164829afaeee3bf7f8', - 'InstanceNUMACellPayload': '1.0-2f13614648bc46f2e29578a206561ef6', + 'InstanceNUMACellPayload': '1.1-2a24ab42bf5e8dfa98291402725bf278', 'InstanceNUMATopologyPayload': '1.0-247361b152047c18ae9ad1da2544a3c9', 'InstancePCIRequestPayload': '1.0-12d0d61baf183daaafd93cbeeed2956f', 'InstancePCIRequestsPayload': '1.0-6751cffe0c0fabd212aad624f672429a',