From 3e6829a2012dd557a9e7c64281d4e6c73d1e3632 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Wed, 10 Oct 2012 21:36:24 +0000 Subject: Pass correct task_state on snapshot This fixes an issue where we were not passing the correct task_state to the compute manager thereby triggering an 'unexpected task-state error' when the snapshot finished. This error only manifested itself in multi-cell setups where the compute-manager and compute-api are using separate DB's and therefore must rely on the RPC-layer to enforce consistency. Fixes bug 1065250 Change-Id: Ie07454f0d2075f5c3f2dd53b4e5ff9983ea3241f --- nova/compute/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nova/compute/api.py b/nova/compute/api.py index a4435b5b6..f13fc55d4 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1202,6 +1202,11 @@ class API(base.Base): self.db.instance_test_and_set( context, instance_uuid, 'task_state', [None], task_state) + # NOTE(sirp): `instance_test_and_set` only sets the task-state in the + # DB, but we also need to set it on the current instance so that the + # correct value is passed down to the compute manager. + instance['task_state'] = task_state + notifications.send_update_with_states(context, instance, old_vm_state, instance["vm_state"], old_task_state, instance["task_state"], service="api", verify_states=True) -- cgit