From 5eb0db9b369dbcf594e0dd66fcebf12c69699417 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 16 Feb 2017 15:11:11 +0200 Subject: [PATCH] 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. (cherry-picked from commit 568a682e5efa6e4fd49b69e02cbd80f1d8a96c63) Change-Id: I9097debeb68cb25dec27e7b3e979cf51d951c250 Closes-Bug: #1657424 --- hyperv/nova/migrationops.py | 2 +- hyperv/tests/unit/test_migrationops.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hyperv/nova/migrationops.py b/hyperv/nova/migrationops.py index c9c67eb7..3f5c877e 100644 --- a/hyperv/nova/migrationops.py +++ b/hyperv/nova/migrationops.py @@ -225,7 +225,7 @@ class MigrationOps(object): self._check_and_attach_config_drive(instance, vm_gen) self._vmops.set_boot_order(instance.name, vm_gen, block_device_info) if power_on: - self._vmops.power_on(instance) + self._vmops.power_on(instance, network_info=network_info) def _check_and_update_disks(self, context, instance, vm_gen, image_meta, block_device_info, resize_instance=False): diff --git a/hyperv/tests/unit/test_migrationops.py b/hyperv/tests/unit/test_migrationops.py index adf34a01..0087975b 100644 --- a/hyperv/tests/unit/test_migrationops.py +++ b/hyperv/tests/unit/test_migrationops.py @@ -324,7 +324,8 @@ class MigrationOpsTestCase(test_base.HyperVBaseTestCase): self._migrationops._vmops.set_boot_order.assert_called_once_with( mock_instance.name, get_image_vm_gen.return_value, mock.sentinel.block_device_info) - self._vmops.power_on.assert_called_once_with(mock_instance) + self._vmops.power_on.assert_called_once_with( + mock_instance, network_info=mock.sentinel.network_info) @ddt.data(constants.DISK, mock.sentinel.root_type) @mock.patch.object(migrationops.MigrationOps, '_check_base_disk')