Hyper-V: Perform proper cleanup after cold migration
At the moment, vif ports and volume connections are not cleaned up
on the source node after a cold migration.
This change addresses this issue by passing the network and block
device info objects when destroying the instance.
Change-Id: I4fd61a6ac09f194ad8be61e6dda092bfd402b806
Closes-Bug: #1705683
(cherry picked from commit 20196b74de
)
This commit is contained in:
parent
657a63d9f5
commit
cd82d551a9
|
@ -201,7 +201,8 @@ class MigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
||||||
|
|
||||||
self._migrationops.migrate_disk_and_power_off(
|
self._migrationops.migrate_disk_and_power_off(
|
||||||
self.context, instance, mock.sentinel.FAKE_DEST, flavor,
|
self.context, instance, mock.sentinel.FAKE_DEST, flavor,
|
||||||
network_info, None, self._FAKE_TIMEOUT, self._FAKE_RETRY_INTERVAL)
|
network_info, mock.sentinel.bdi,
|
||||||
|
self._FAKE_TIMEOUT, self._FAKE_RETRY_INTERVAL)
|
||||||
|
|
||||||
mock_check_flavor.assert_called_once_with(instance, flavor)
|
mock_check_flavor.assert_called_once_with(instance, flavor)
|
||||||
self._migrationops._vmops.power_off.assert_called_once_with(
|
self._migrationops._vmops.power_off.assert_called_once_with(
|
||||||
|
@ -210,7 +211,7 @@ class MigrationOpsTestCase(test_base.HyperVBaseTestCase):
|
||||||
mock_migrate_disk_files.assert_called_once_with(
|
mock_migrate_disk_files.assert_called_once_with(
|
||||||
instance.name, disk_files, mock.sentinel.FAKE_DEST)
|
instance.name, disk_files, mock.sentinel.FAKE_DEST)
|
||||||
self._migrationops._vmops.destroy.assert_called_once_with(
|
self._migrationops._vmops.destroy.assert_called_once_with(
|
||||||
instance, destroy_disks=False)
|
instance, network_info, mock.sentinel.bdi, destroy_disks=False)
|
||||||
|
|
||||||
def test_confirm_migration(self):
|
def test_confirm_migration(self):
|
||||||
mock_instance = fake_instance.fake_instance_obj(self.context)
|
mock_instance = fake_instance.fake_instance_obj(self.context)
|
||||||
|
|
|
@ -129,7 +129,8 @@ class MigrationOps(object):
|
||||||
if disk_files:
|
if disk_files:
|
||||||
self._migrate_disk_files(instance.name, disk_files, dest)
|
self._migrate_disk_files(instance.name, disk_files, dest)
|
||||||
|
|
||||||
self._vmops.destroy(instance, destroy_disks=False)
|
self._vmops.destroy(instance, network_info,
|
||||||
|
block_device_info, destroy_disks=False)
|
||||||
|
|
||||||
# disk_info is not used
|
# disk_info is not used
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Reference in New Issue