diff options
| author | sridevik <koushiksridevi8@gmail.com> | 2013-06-20 10:20:06 -0500 |
|---|---|---|
| committer | sridevik <koushiksridevi8@gmail.com> | 2013-06-20 23:05:36 -0500 |
| commit | 2cb31123302a1ec8c8dec0cb2ac288a2e3b19c68 (patch) | |
| tree | 9db9019e3c2e2a5dbc37efbe3018a30917857870 /nova/virt | |
| parent | 75ead3a2a37efbc6a4fdea7e492ca41cdd559a8c (diff) | |
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
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 6 |
1 files changed, 5 insertions, 1 deletions
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) |
