diff options
Diffstat (limited to 'nova/virt/xenapi/vmops.py')
-rw-r--r-- | nova/virt/xenapi/vmops.py | 12 |
1 files changed, 7 insertions, 5 deletions
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): |