Merge "Remove workaround for ovn live migration"

This commit is contained in:
Zuul 2025-04-25 19:41:40 +00:00 committed by Gerrit Code Review
commit 2b06c9c6c2
3 changed files with 2 additions and 28 deletions

View File

@ -9399,8 +9399,8 @@ class ComputeManager(manager.Manager):
# We don't generate events if CONF.vif_plugging_timeout=0
# meaning that the operator disabled using them.
if CONF.vif_plugging_timeout:
return (instance.get_network_info()
.get_live_migration_plug_time_events())
return [('network-vif-plugged', vif['id'])
for vif in instance.get_network_info()]
else:
return []

View File

@ -489,14 +489,6 @@ class VIF(Model):
'ips': ips}
return []
@property
def has_live_migration_plug_time_event(self):
"""Returns whether this VIF's network-vif-plugged external event will
be sent by Neutron at "plugtime" - in other words, as soon as neutron
completes configuring the network backend.
"""
return self.is_hybrid_plug_enabled()
def is_hybrid_plug_enabled(self):
return self['details'].get(VIF_DETAILS_OVS_HYBRID_PLUG, False)
@ -557,13 +549,6 @@ class NetworkInfo(list):
def json(self):
return jsonutils.dumps(self)
def get_live_migration_plug_time_events(self):
"""Returns a list of external events for any VIFs that have
"plug-time" events during live migration.
"""
return [('network-vif-plugged', vif['id'])
for vif in self if vif.has_live_migration_plug_time_event]
def has_port_with_allocation(self):
return any(vif.has_allocation() for vif in self)

View File

@ -11914,17 +11914,6 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase,
[], self.compute._get_neutron_events_for_live_migration(
self.instance))
# 3. no plug time events
with mock.patch.object(self.instance, 'get_network_info') as nw_info:
nw_info.return_value = network_model.NetworkInfo(
[network_model.VIF(
uuids.port1, details={
network_model.VIF_DETAILS_OVS_HYBRID_PLUG: False})])
self.assertFalse(nw_info.return_value[0].is_hybrid_plug_enabled())
self.assertEqual(
[], self.compute._get_neutron_events_for_live_migration(
self.instance))
@mock.patch('nova.compute.rpcapi.ComputeAPI.pre_live_migration')
@mock.patch('nova.compute.manager.ComputeManager._post_live_migration')
@mock.patch('nova.objects.BlockDeviceMappingList.get_by_instance_uuid')