summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/virt/xenapi/vmops.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 5dcc53b94..61bb16306 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -1089,8 +1089,12 @@ class VMOps(object):
def power_off(self, instance):
"""Power off the specified instance."""
- vm_ref = self._get_vm_opaque_ref(instance)
- vm_utils.shutdown_vm(self._session, instance, vm_ref, hard=True)
+ try:
+ vm_ref = self._get_vm_opaque_ref(instance)
+ vm_utils.shutdown_vm(self._session, instance, vm_ref, hard=True)
+ except exception.NotFound:
+ LOG.warning(_("VM is not present, skipping power off..."),
+ instance=instance)
def power_on(self, instance):
"""Power on the specified instance."""