summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Harris <rconradharris@gmail.com>2012-10-10 21:36:24 +0000
committerRick Harris <rconradharris@gmail.com>2012-10-11 17:04:02 -0500
commit3e6829a2012dd557a9e7c64281d4e6c73d1e3632 (patch)
tree691a338c4461b7e593cfd445949c79fae47836eb
parent93d2a2cdbc86e541ee50e295a602639e7e572817 (diff)
downloadnova-3e6829a2012dd557a9e7c64281d4e6c73d1e3632.tar.gz
nova-3e6829a2012dd557a9e7c64281d4e6c73d1e3632.tar.xz
nova-3e6829a2012dd557a9e7c64281d4e6c73d1e3632.zip
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
-rw-r--r--nova/compute/api.py5
1 files changed, 5 insertions, 0 deletions
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)