From d00f09f2ebfa17b1b66ac080f4719f925e0777de Mon Sep 17 00:00:00 2001 From: Unmesh Gurjar Date: Fri, 2 Nov 2012 07:08:46 -0700 Subject: Fixed instance deletion issue from Nova API. When host Compute is down, Nova API deletes the resources associated with the instance. However, since the instance is marked deleted first, the next query to update the instance vm_state and task_state in DB fails. And instance remains in state vm_state=ACTIVE, task_state=DELETING, deleted=True. Fixes LP: #1074305 Change-Id: I0a4e64d180b4b2c5e398a21a62b29b7d59549a9f --- nova/compute/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 28c7068ba..0987b0549 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -954,7 +954,6 @@ class API(base.Base): elevated = context.elevated() self.network_api.deallocate_for_instance(elevated, instance) - self.db.instance_destroy(context, instance_uuid) system_meta = self.db.instance_system_metadata_get(context, instance_uuid) @@ -979,6 +978,7 @@ class API(base.Base): vm_state=vm_states.DELETED, task_state=None, terminated_at=timeutils.utcnow()) + self.db.instance_destroy(context, instance_uuid) compute_utils.notify_about_instance_usage( context, instance, "delete.end", system_metadata=system_meta) -- cgit