hyperv: make sure to plug OVS VIFs after resize/migrate

Since the network_info wasn't getting passed to vmops.power_on
after a resize/cold migrate confirmation, the OVS VIFs weren't
getting plugged.

NOTE(claudiub): the way migrations work changed in Ocata, which is
the reason of the conflict.

(cherry-picked from commit 568a682e5efa6e4fd49b69e02cbd80f1d8a96c63)

(cherry picked from commit 5eb0db9b36)

Conflicts:
	hyperv/nova/migrationops.py
	hyperv/tests/unit/test_migrationops.py

Closes-Bug: #1657424

Change-Id: I9097debeb68cb25dec27e7b3e979cf51d951c250
This commit is contained in:
Claudiu Belu 2017-02-16 15:11:11 +02:00
parent 4d64fa591d
commit 701f37a9fa
2 changed files with 2 additions and 2 deletions

View File

@ -298,7 +298,7 @@ class MigrationOps(object):
self._check_and_attach_config_drive(instance, vm_gen)
self._vmops.set_boot_order(vm_gen, block_device_info, instance_name)
if power_on:
self._vmops.power_on(instance)
self._vmops.power_on(instance, network_info=network_info)
def _check_ephemeral_disks(self, instance, ephemerals,
resize_instance=False):

View File

@ -428,7 +428,7 @@ class MigrationOpsTestCase(test_base.HyperVBaseTestCase):
mock_check_attach_config_drive.assert_called_once_with(
mock_instance, get_image_vm_gen.return_value)
self._migrationops._vmops.power_on.assert_called_once_with(
mock_instance)
mock_instance, network_info=mock.sentinel.network_info)
def test_finish_migration(self):
self._check_finish_migration(disk_type=constants.DISK)