Skip to content

Commit 4817165

Browse files
committed
Wait for network-vif-plugged on resize revert
Change Id515137747a4b76e9b7057c95f80c8ae74017519 modified the libvirt driver to not wait for network-vif-plugged events on resize revert, saying that the vifs were never unplugged. That's true for the source host but not the dest host. The ComputeManager.revert_resize method calls driver.destroy and for the libvirt driver, driver.destroy calls cleanup which calls unplug_vifs *on the dest host*. As of change If00736ab36df4a5a3be4f02b0a550e4bcae77b1b, the API will route all events to both the source and dest host while the instance has a migration_context. When revert_resize is done on the dest host, it RPC casts to finish_revert_resize on the source host which calls driver.finish_revert_migration which restarts the guest on the source host and plugs vifs. Therefore, we can wait for the network-vif-plugged event before changing the instance status back to ACTIVE. Change-Id: I9e0cffb889c94713c7f28812918103a5d97cefeb Related-Bug: #1788403
1 parent 17b6957 commit 4817165

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

nova/tests/unit/virt/libvirt/test_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18670,7 +18670,7 @@ def fake_create_domain(context, xml, instance, network_info,
1867018670
vifs_already_plugged=None):
1867118671
self.fake_create_domain_called = True
1867218672
self.assertEqual(powered_on, power_on)
18673-
self.assertTrue(vifs_already_plugged)
18673+
self.assertFalse(vifs_already_plugged)
1867418674
return mock.MagicMock()
1867518675

1867618676
def fake_enable_hairpin():

nova/virt/libvirt/driver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8482,8 +8482,7 @@ def finish_revert_migration(self, context, instance, network_info,
84828482
block_device_info=block_device_info)
84838483
self._create_domain_and_network(context, xml, instance, network_info,
84848484
block_device_info=block_device_info,
8485-
power_on=power_on,
8486-
vifs_already_plugged=True)
8485+
power_on=power_on)
84878486

84888487
if power_on:
84898488
timer = loopingcall.FixedIntervalLoopingCall(

0 commit comments

Comments
 (0)