summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-04-19 15:06:27 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-04-19 15:29:04 +0000
commit07d54c27a32e66884495b00ec7c19d679cdb823f (patch)
tree612e77f155e5ab51faba1f6409371ae02f1d0edd /nova
parent1f644d210557b1254f7c7b39424b09a45329ade7 (diff)
downloadnova-07d54c27a32e66884495b00ec7c19d679cdb823f.tar.gz
nova-07d54c27a32e66884495b00ec7c19d679cdb823f.tar.xz
nova-07d54c27a32e66884495b00ec7c19d679cdb823f.zip
Be more tolerant of deleting failed builds
Fixes bug 985705 If an instance fails to build, the xen server may not have an instance. This can cause _get_opaque_vm_ref to unnecessarily raise an exception and add an instance fault that is misleading. Change-Id: I068d0af284a5671f429b2d8b13a25b629ede59bd
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/vmops.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 84da93e73..6883e9c8c 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -1109,7 +1109,10 @@ class VMOps(object):
"""
LOG.info(_("Destroying VM"), instance=instance)
- vm_ref = self._get_vm_opaque_ref(instance)
+ # We don't use _get_vm_opaque_ref because the instance may
+ # truly not exist because of a failure during build. A valid
+ # vm_ref is checked correctly where necessary.
+ vm_ref = VMHelper.lookup(self._session, instance['name'])
rescue_vm_ref = VMHelper.lookup(self._session,
"%s-rescue" % instance.name)