diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-01 18:31:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-01 18:31:18 +0000 |
| commit | 423289d50d92cf4b780a11c2c3da4e1dbbd865f2 (patch) | |
| tree | 3ff9e6b8558a289b0d98aa63df57a67954ef4f96 /nova/virt | |
| parent | 08968d255df65a0a290dabcc5c8d63d5b7d2bca4 (diff) | |
| parent | 9eb3dc7ed44d99652a17238724842e3067d46120 (diff) | |
Merge "Reset migrating task state for MigrationError exceptions"
Diffstat (limited to 'nova/virt')
| -rwxr-xr-x | nova/virt/libvirt/driver.py | 2 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index dc0af8539..c365c5fdd 100755 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2968,7 +2968,7 @@ class LibvirtDriver(driver.ComputeDriver): "Disk of instance is too large(available" " on destination host:%(available)s " "< need:%(necessary)s)") - raise exception.MigrationError(reason=reason % locals()) + raise exception.MigrationPreCheckError(reason=reason % locals()) def _compare_cpu(self, cpu_info): """Checks the host cpu is compatible to a cpu given by xml. diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 48413ed7c..e7dd3cff0 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -1625,7 +1625,7 @@ class VMOps(object): except KeyError: reason = _('Destination host:%(hostname)s must be in the same ' 'aggregate as the source server') - raise exception.MigrationError(reason=reason % locals()) + raise exception.MigrationPreCheckError(reason=reason % locals()) def _ensure_host_in_aggregate(self, context, hostname): self._get_host_uuid_from_aggregate(context, hostname) @@ -1644,7 +1644,8 @@ class VMOps(object): pifs = self._session.call_xenapi('PIF.get_all_records_where', expr) if len(pifs) != 1: - raise exception.MigrationError('No suitable network for migrate') + msg = _('No suitable network for migrate') + raise exception.MigrationPreCheckError(reason=msg) nwref = pifs[pifs.keys()[0]]['network'] try: @@ -1655,7 +1656,8 @@ class VMOps(object): options) except self._session.XenAPI.Failure as exc: LOG.exception(exc) - raise exception.MigrationError(_('Migrate Receive failed')) + msg = _('Migrate Receive failed') + raise exception.MigrationPreCheckError(reason=msg) return migrate_data def check_can_live_migrate_destination(self, ctxt, instance_ref, @@ -1703,8 +1705,8 @@ class VMOps(object): "VM.assert_can_migrate", vm_ref, migrate_data) except self._session.XenAPI.Failure as exc: LOG.exception(exc) - raise exception.MigrationError(_('VM.assert_can_migrate' - 'failed')) + msg = _('VM.assert_can_migrate failed') + raise exception.MigrationPreCheckError(reason=msg) return dest_check_data def _generate_vdi_map(self, destination_sr_ref, vm_ref): |
