Skip to content

Commit

Permalink
Wait for network-vif-plugged on resize revert
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mriedem committed Aug 22, 2018
1 parent 17b6957 commit 4817165
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nova/tests/unit/virt/libvirt/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18670,7 +18670,7 @@ def fake_create_domain(context, xml, instance, network_info,
vifs_already_plugged=None):
self.fake_create_domain_called = True
self.assertEqual(powered_on, power_on)
self.assertTrue(vifs_already_plugged)
self.assertFalse(vifs_already_plugged)
return mock.MagicMock()

def fake_enable_hairpin():
Expand Down
3 changes: 1 addition & 2 deletions nova/virt/libvirt/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8482,8 +8482,7 @@ def finish_revert_migration(self, context, instance, network_info,
block_device_info=block_device_info)
self._create_domain_and_network(context, xml, instance, network_info,
block_device_info=block_device_info,
power_on=power_on,
vifs_already_plugged=True)
power_on=power_on)

if power_on:
timer = loopingcall.FixedIntervalLoopingCall(
Expand Down

0 comments on commit 4817165

Please sign in to comment.