From 2cb31123302a1ec8c8dec0cb2ac288a2e3b19c68 Mon Sep 17 00:00:00 2001 From: sridevik Date: Thu, 20 Jun 2013 10:20:06 -0500 Subject: XenApi virt driver should throw exception on failure Virt xenapi driver does not throw InstancePowerOffFailure exception on a failure while destroying an instance. _shutdown_instance in compute manager expects InstancePowerOffFailure and reraises it. This ensures that instances are not wrongly marked as deleted. Change-Id: Id57f48a00202bd5ed3125f8e4396a51c12e142cb Fixes: bug #1190076 --- nova/virt/xenapi/vmops.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nova/virt') diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 80a4fb48a..d18fc2729 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -1253,7 +1253,11 @@ class VMOps(object): instance=instance) return - vm_utils.hard_shutdown_vm(self._session, instance, vm_ref) + shutdown_success = vm_utils.hard_shutdown_vm(self._session, instance, + vm_ref) + if not shutdown_success: + raise exception.InstancePowerOffFailure( + _("XenAPI failed to power the instance off")) if destroy_disks: self._volumeops.detach_all(vm_ref) -- cgit