Merge "Remove block_migration from LM rollback"
This commit is contained in:
commit
952af64583
|
@ -5300,7 +5300,7 @@ class ComputeManager(manager.Manager):
|
|||
dest, instance=instance)
|
||||
self._set_migration_status(migration, 'error')
|
||||
self._rollback_live_migration(context, instance, dest,
|
||||
block_migration, migrate_data)
|
||||
migrate_data)
|
||||
|
||||
self._set_migration_status(migration, 'running')
|
||||
|
||||
|
@ -5634,7 +5634,7 @@ class ComputeManager(manager.Manager):
|
|||
@wrap_exception()
|
||||
@wrap_instance_fault
|
||||
def _rollback_live_migration(self, context, instance,
|
||||
dest, block_migration, migrate_data=None,
|
||||
dest, migrate_data=None,
|
||||
migration_status='error'):
|
||||
"""Recovers Instance/volume state from migrating -> running.
|
||||
|
||||
|
@ -5643,7 +5643,6 @@ class ComputeManager(manager.Manager):
|
|||
:param dest:
|
||||
This method is called from live migration src host.
|
||||
This param specifies destination host.
|
||||
:param block_migration: if true, prepare for block migration
|
||||
:param migrate_data:
|
||||
if not none, contains implementation specific data.
|
||||
:param migration_status:
|
||||
|
|
|
@ -5937,7 +5937,6 @@ class ComputeTestCase(BaseTestCase):
|
|||
def _test(mock_nw_api, mock_lmcf):
|
||||
mock_lmcf.return_value = False, False
|
||||
self.compute._rollback_live_migration(c, instance, 'foo',
|
||||
False,
|
||||
migrate_data=migrate_data)
|
||||
mock_nw_api.setup_networks_on_host.assert_called_once_with(
|
||||
c, instance, self.compute.host)
|
||||
|
@ -5961,7 +5960,6 @@ class ComputeTestCase(BaseTestCase):
|
|||
def _test(mock_nw_api, mock_lmcf):
|
||||
mock_lmcf.return_value = False, False
|
||||
self.compute._rollback_live_migration(c, instance, 'foo',
|
||||
False,
|
||||
migrate_data=migrate_data,
|
||||
migration_status='fake')
|
||||
mock_nw_api.setup_networks_on_host.assert_called_once_with(
|
||||
|
|
|
@ -4978,7 +4978,7 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase):
|
|||
mock_lmcf.return_value = False, False
|
||||
compute._rollback_live_migration(self.context,
|
||||
mock.MagicMock(),
|
||||
'foo', False, {})
|
||||
'foo', {})
|
||||
self.assertIsInstance(mock_lmcf.call_args_list[0][0][0],
|
||||
migrate_data_obj.LiveMigrateData)
|
||||
|
||||
|
|
|
@ -74,7 +74,6 @@ class LiveMigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
|||
migrate_data)
|
||||
mock_recover.assert_called_once_with(self.context, mock_instance,
|
||||
fake_dest,
|
||||
mock.sentinel.block_migr,
|
||||
migrate_data)
|
||||
else:
|
||||
self._livemigrops.live_migration(context=self.context,
|
||||
|
|
|
@ -8496,11 +8496,11 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
|||
'Post method called when success not expected')
|
||||
if expected_mig_status:
|
||||
fake_recover_method.assert_called_once_with(
|
||||
self.context, instance, dest, False, migrate_data,
|
||||
self.context, instance, dest, migrate_data,
|
||||
migration_status=expected_mig_status)
|
||||
else:
|
||||
fake_recover_method.assert_called_once_with(
|
||||
self.context, instance, dest, False, migrate_data)
|
||||
self.context, instance, dest, migrate_data)
|
||||
self.assertNotIn(instance.uuid, drvr.active_migrations)
|
||||
|
||||
def test_live_migration_monitor_success(self):
|
||||
|
|
|
@ -3649,8 +3649,7 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBaseNoDB):
|
|||
self.stubs.Set(self.conn._vmops._session, "call_xenapi",
|
||||
fake_call_xenapi)
|
||||
|
||||
def recover_method(context, instance, destination_hostname,
|
||||
block_migration):
|
||||
def recover_method(context, instance, destination_hostname):
|
||||
recover_method.called = True
|
||||
migrate_data = objects.XenapiLiveMigrateData(
|
||||
destination_sr_ref="foo",
|
||||
|
@ -3718,8 +3717,7 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBaseNoDB):
|
|||
|
||||
self._add_default_live_migrate_stubs(self.conn)
|
||||
|
||||
def recover_method(context, instance, destination_hostname,
|
||||
block_migration):
|
||||
def recover_method(context, instance, destination_hostname):
|
||||
recover_method.called = True
|
||||
# pass block_migration = True and migrate data
|
||||
migrate_data = objects.XenapiLiveMigrateData(
|
||||
|
|
|
@ -77,8 +77,7 @@ class LiveMigrationOps(object):
|
|||
with excutils.save_and_reraise_exception():
|
||||
LOG.debug("Calling live migration recover_method "
|
||||
"for instance: %s", instance_name)
|
||||
recover_method(context, instance_ref, dest, block_migration,
|
||||
migrate_data)
|
||||
recover_method(context, instance_ref, dest, migrate_data)
|
||||
|
||||
LOG.debug("Calling live migration post_method for instance: %s",
|
||||
instance_name)
|
||||
|
|
|
@ -6306,8 +6306,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
|||
instance=instance)
|
||||
libvirt_migrate.run_recover_tasks(self._host, guest, instance,
|
||||
on_migration_failure)
|
||||
recover_method(context, instance, dest, block_migration,
|
||||
migrate_data)
|
||||
recover_method(context, instance, dest, migrate_data)
|
||||
break
|
||||
elif info.type == libvirt.VIR_DOMAIN_JOB_CANCELLED:
|
||||
# Migration was stopped by admin
|
||||
|
@ -6315,8 +6314,8 @@ class LibvirtDriver(driver.ComputeDriver):
|
|||
instance=instance)
|
||||
libvirt_migrate.run_recover_tasks(self._host, guest, instance,
|
||||
on_migration_failure)
|
||||
recover_method(context, instance, dest, block_migration,
|
||||
migrate_data, migration_status='cancelled')
|
||||
recover_method(context, instance, dest, migrate_data,
|
||||
migration_status='cancelled')
|
||||
break
|
||||
else:
|
||||
LOG.warning(_LW("Unexpected migration job type: %d"),
|
||||
|
|
|
@ -2406,8 +2406,7 @@ class VMOps(object):
|
|||
block_migration, migrate_data)
|
||||
except Exception:
|
||||
with excutils.save_and_reraise_exception():
|
||||
recover_method(context, instance, destination_hostname,
|
||||
block_migration)
|
||||
recover_method(context, instance, destination_hostname)
|
||||
|
||||
def post_live_migration(self, context, instance, migrate_data=None):
|
||||
if migrate_data is not None:
|
||||
|
|
Loading…
Reference in New Issue