diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-08-24 13:24:37 -0400 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-08-24 13:24:37 -0400 |
| commit | 1c7002db8be430cded6efb7378103e17c8df21b4 (patch) | |
| tree | 0ee8e8f53a07e53df5f96966208269fe1ec089ca | |
| parent | c34c9a008f1314de6eeb41b1f57b6056a3f951f6 (diff) | |
Fixed issue where we were setting the state to DELETED before it's actually deleted.
| -rw-r--r-- | nova/compute/manager.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 7697e8e6c..924799dc4 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -490,15 +490,15 @@ class ComputeManager(manager.SchedulerDependentManager): def terminate_instance(self, context, instance_id): """Terminate an instance on this host.""" self._shutdown_instance(context, instance_id, 'Terminating') - instance = self.db.instance_get(context.elevated(), instance_id) + self.db.instance_destroy(context, instance_id) + self._instance_update(context, instance_id, vm_state=vm_states.DELETED, task_state=None, terminated_at=utils.utcnow()) - # TODO(ja): should we keep it in a terminated state for a bit? - self.db.instance_destroy(context, instance_id) + instance = self.db.instance_get(context.elevated(), instance_id) usage_info = utils.usage_from_instance(instance) notifier.notify('compute.%s' % self.host, 'compute.instance.delete', |
