Remove "live_migration_events" configuration option

This option was introduced in [1]. This option depended on [2],
the Nova code enabling this feature, that filters the
"vif-plugged-event" to be sent to Nova.

Now the default behaviour is "True".

Related-Bug: #1901707

[1]https://review.opendev.org/c/openstack/neutron/+/766277
[2]https://review.opendev.org/c/openstack/nova/+/767368

Change-Id: I05f7e6a7d91f6a4a1fe6d4765589f30257243628
This commit is contained in:
Rodolfo Alonso Hernandez 2022-04-24 00:19:25 +00:00
parent ff8e0f6e31
commit 9025f8a571
6 changed files with 17 additions and 44 deletions

View File

@ -342,9 +342,8 @@ class CacheBackedPluginApi(PluginApi):
port_obj.bindings, constants.ACTIVE, raise_if_not_found=True,
port_id=port_obj.id)
migrating_to = migrating_to_host(port_obj.bindings)
if (not (migrating_to and cfg.CONF.nova.live_migration_events) and
port_obj.device_owner.startswith(
constants.DEVICE_OWNER_COMPUTE_PREFIX) and
if (not migrating_to and port_obj.device_owner.startswith(
constants.DEVICE_OWNER_COMPUTE_PREFIX) and
binding[pb_ext.HOST] != host):
LOG.debug("Device %s has no active binding in this host",
port_obj)

View File

@ -179,24 +179,6 @@ nova_opts = [
help=_('Type of the nova endpoint to use. This endpoint will'
' be looked up in the keystone catalog and should be'
' one of public, internal or admin.')),
cfg.BoolOpt('live_migration_events', default=False,
help=_('When this option is enabled, during the live '
'migration, the OVS agent will only send the '
'"vif-plugged-event" when the destination host '
'interface is bound. This option also disables any '
'other agent (like DHCP) to send to Nova this event '
'when the port is provisioned.'
'This option can be enabled if Nova patch '
'https://review.opendev.org/c/openstack/nova/+/767368 '
'is in place.'
'This option is temporary and will be removed in Y and '
'the behavior will be "True".'),
deprecated_for_removal=True,
deprecated_reason=(
'In Y the Nova patch '
'https://review.opendev.org/c/openstack/nova/+/767368 '
'will be in the code even when running a Nova server in '
'X.')),
]

View File

@ -369,8 +369,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
host_migrating = agent_rpc.migrating_to_host(
getattr(port, 'port_bindings', []))
if (host_migrating and cfg.CONF.nova.live_migration_events and
self.nova_notifier):
if host_migrating and self.nova_notifier:
send_nova_event = bool(trigger ==
provisioning_blocks.L2_AGENT_ENTITY)
with self.nova_notifier.context_enabled(send_nova_event):

View File

@ -352,21 +352,13 @@ class TestCacheBackedPluginApi(base.BaseTestCase):
self.assertIn(constants.NO_ACTIVE_BINDING, entry)
def test_get_device_details_migrating_to_host(self):
for live_migration_events, migrating_to in ((True, 'host2'),
(False, 'irrelevant')):
cfg.CONF.set_override('live_migration_events',
live_migration_events, group='nova')
profile = jsonutils.dumps({'migrating_to': migrating_to})
self._port.bindings[0].profile = profile
self._api.remote_resource_cache.get_resource_by_id.side_effect = [
self._port, self._network]
entry = self._api.get_device_details(mock.ANY, self._port_id,
mock.ANY, 'host2')
if live_migration_events:
self.assertEqual('host2', entry['migrating_to'])
else:
self.assertTrue(entry[constants.NO_ACTIVE_BINDING])
self.assertNotIn('migrating_to', entry)
profile = jsonutils.dumps({'migrating_to': 'host2'})
self._port.bindings[0].profile = profile
self._api.remote_resource_cache.get_resource_by_id.side_effect = [
self._port, self._network]
entry = self._api.get_device_details(mock.ANY, self._port_id,
mock.ANY, 'host2')
self.assertEqual('host2', entry['migrating_to'])
@mock.patch('neutron.agent.resource_cache.RemoteResourceCache')
def test_initialization_with_default_resources(self, rcache_class):

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
The ``live_migration_events`` configuration option is removed. Now Neutron
assumes this flag is always set. This configuration option depended on
the Nova patch
`only wait for plugtime events in pre-live-migration <https://review.opendev.org/c/openstack/nova/+/767368>`_.

View File

@ -205,9 +205,6 @@
s-proxy: false
devstack_local_conf:
post-config:
$NEUTRON_CONF:
nova:
live_migration_events: True
$NEUTRON_L3_CONF:
agent:
debug_iptables_rules: True
@ -239,9 +236,6 @@
c-vol: false
devstack_local_conf:
post-config:
$NEUTRON_CONF:
nova:
live_migration_events: True
$NEUTRON_L3_CONF:
agent:
debug_iptables_rules: True