summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-08 19:13:26 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-03-08 19:47:31 +0000
commit5555446d877223341c2723e4be169d996ab2ce3b (patch)
tree2c03dae51a23ec9a22a6507ef4254894c03fb96e
parenta5fba51ce08e6f93134b434fccd5a960f7e215ec (diff)
downloadnova-5555446d877223341c2723e4be169d996ab2ce3b.tar.gz
nova-5555446d877223341c2723e4be169d996ab2ce3b.tar.xz
nova-5555446d877223341c2723e4be169d996ab2ce3b.zip
Wait for rescue VM shutdown to complete before destroying it
Fixes bug 950168 Also, wait for the VM and VDI destroys to complete so any errors can get logged Change-Id: I2c2237ed6f95828198824db8628d267ac5b26b3a
-rw-r--r--nova/virt/xenapi/vmops.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index fe912c43d..9de6242bf 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -1091,7 +1091,7 @@ class VMOps(object):
def _shutdown_rescue(self, rescue_vm_ref):
"""Shutdown a rescue instance."""
- self._session.call_xenapi("Async.VM.hard_shutdown", rescue_vm_ref)
+ self._session.call_xenapi("VM.hard_shutdown", rescue_vm_ref)
def _destroy_vdis(self, instance, vm_ref):
"""Destroys all VDIs associated with a VM."""
@@ -1115,9 +1115,9 @@ class VMOps(object):
vdi_refs = VMHelper.lookup_vm_vdis(self._session, rescue_vm_ref)
for vdi_ref in vdi_refs:
try:
- self._session.call_xenapi("Async.VDI.destroy", vdi_ref)
- except self.XenAPI.Failure:
- continue
+ VMHelper.destroy_vdi(self._session, vdi_ref)
+ except volume_utils.StorageError as exc:
+ LOG.error(exc)
def _destroy_rescue_vbds(self, rescue_vm_ref):
"""Destroys all VBDs tied to a rescue VM."""
@@ -1187,7 +1187,7 @@ class VMOps(object):
self._shutdown_rescue(rescue_vm_ref)
self._destroy_rescue_vdis(rescue_vm_ref)
- self._session.call_xenapi("Async.VM.destroy", rescue_vm_ref)
+ self._session.call_xenapi("VM.destroy", rescue_vm_ref)
def destroy(self, instance, network_info):
"""Destroy VM instance.