From 62714e290ce99c560a9d22c58d297eef62589eaf Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Thu, 22 Jan 2026 10:17:20 +0100 Subject: [PATCH] Revert "Update migration notification" This reverts commit 6d965121880f7d581d5773faa9d6c9c6eb65ce65. The instance.live_migration_post.end event is created in the source node before the migration has finished, it shows state migrating and the source node as host. The instance.live_migration_post_dest.end is created in the destination after the migraion is finished, shows task_state None and the correct destination node as host. It also adds a release note. Closes-Bug: #2138857 Change-Id: I751170e4ba1aa5ede0559dae8380120611ecf1e4 Signed-off-by: Alfredo Moralejo (cherry picked from commit 857e14a9d8180dc4cfe24a1c3eb77dd579dc3547) --- releasenotes/notes/bug-2138857-e3505aa4a20a7831.yaml | 7 +++++++ watcher/decision_engine/model/notification/nova.py | 2 +- ...end.json => instance-live_migration_post_dest-end.json} | 4 ++-- .../model/notification/test_nova_notifications.py | 6 +++--- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/bug-2138857-e3505aa4a20a7831.yaml rename watcher/tests/decision_engine/model/notification/data/{instance-live_migration_post-end.json => instance-live_migration_post_dest-end.json} (97%) diff --git a/releasenotes/notes/bug-2138857-e3505aa4a20a7831.yaml b/releasenotes/notes/bug-2138857-e3505aa4a20a7831.yaml new file mode 100644 index 000000000..1264f6d76 --- /dev/null +++ b/releasenotes/notes/bug-2138857-e3505aa4a20a7831.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Notification-based updates of the nova DataModel failed to set the + actual destination host as compute node after Live Migrations. The + Nova collector is now using the right Nova notification to update + the instance in the DataModel after those events. diff --git a/watcher/decision_engine/model/notification/nova.py b/watcher/decision_engine/model/notification/nova.py index 7a11645bd..3a09ebbd5 100644 --- a/watcher/decision_engine/model/notification/nova.py +++ b/watcher/decision_engine/model/notification/nova.py @@ -341,7 +341,7 @@ class VersionedNotification(NovaNotification): 'instance.rescue.end': instance_updated, 'instance.update': instance_updated, 'instance.live_migration_force_complete.end': instance_updated, - 'instance.live_migration_post.end': instance_updated, + 'instance.live_migration_post_dest.end': instance_updated, 'instance.delete.end': instance_deleted, 'instance.soft_delete.end': instance_deleted, 'service.create': service_updated, diff --git a/watcher/tests/decision_engine/model/notification/data/instance-live_migration_post-end.json b/watcher/tests/decision_engine/model/notification/data/instance-live_migration_post_dest-end.json similarity index 97% rename from watcher/tests/decision_engine/model/notification/data/instance-live_migration_post-end.json rename to watcher/tests/decision_engine/model/notification/data/instance-live_migration_post_dest-end.json index faf527807..a160e262d 100644 --- a/watcher/tests/decision_engine/model/notification/data/instance-live_migration_post-end.json +++ b/watcher/tests/decision_engine/model/notification/data/instance-live_migration_post_dest-end.json @@ -1,5 +1,5 @@ { - "event_type": "instance.live_migration_post.end", + "event_type": "instance.live_migration_post_dest.end", "payload": { "nova_object.data": { "action_initiator_project": "6f70656e737461636b20342065766572", @@ -49,7 +49,7 @@ "nova_object.namespace": "nova", "nova_object.version": "1.4" }, - "host": "Node_1", + "host": "host2", "host_name": "some-server", "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6", "ip_addresses": [ diff --git a/watcher/tests/decision_engine/model/notification/test_nova_notifications.py b/watcher/tests/decision_engine/model/notification/test_nova_notifications.py index 1d94f8fb2..65590bf41 100644 --- a/watcher/tests/decision_engine/model/notification/test_nova_notifications.py +++ b/watcher/tests/decision_engine/model/notification/test_nova_notifications.py @@ -72,8 +72,8 @@ class TestReceiveNovaNotifications(NotificationTestCase): 'instance.update': 'instance-update.json', 'instance.live_migration_force_complete.end': 'instance-live_migration_force_complete-end.json', - 'instance.live_migration_post.end': - 'instance-live_migration_post-end.json', + 'instance.live_migration_post_dest.end': + 'instance-live_migration_post_dest-end.json', 'instance.delete.end': 'instance-delete-end.json', 'instance.soft_delete.end': 'instance-soft_delete-end.json', 'service.create': 'service-create.json', @@ -546,7 +546,7 @@ class TestNovaNotifications(NotificationTestCase): node = compute_model.get_node_by_instance_uuid(instance0_uuid) self.assertEqual('fa69c544-906b-4a6a-a9c6-c1f7a8078c73', node.uuid) message = self.load_message( - 'instance-live_migration_post-end.json') + 'instance-live_migration_post_dest-end.json') handler.info( ctxt=self.context, publisher_id=message['publisher_id'],