diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index a58cd90958ec..cbd87fd5cf41 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -12608,7 +12608,7 @@ class LibvirtConnTestCase(test.NoDBTestCase, block_device_info=block_device_info, mdevs=[uuids.mdev1]) mock_create_domain_and_network.assert_called_once_with(self.context, dummyxml, instance, network_info, - block_device_info=block_device_info) + block_device_info=block_device_info, vifs_already_plugged=True) @mock.patch('oslo_utils.fileutils.ensure_tree') @mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall') diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 1f921c1fefd0..fb1394e596f9 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2708,8 +2708,14 @@ class LibvirtDriver(driver.ComputeDriver): # Initialize all the necessary networking, block devices and # start the instance. + # NOTE(melwitt): Pass vifs_already_plugged=True here even though we've + # unplugged vifs earlier. The behavior of neutron plug events depends + # on which vif type we're using and we are working with a stale network + # info cache here, so won't rely on waiting for neutron plug events. + # vifs_already_plugged=True means "do not wait for neutron plug events" self._create_domain_and_network(context, xml, instance, network_info, - block_device_info=block_device_info) + block_device_info=block_device_info, + vifs_already_plugged=True) self._prepare_pci_devices_for_use( pci_manager.get_instance_pci_devs(instance, 'all'))