diff --git a/neutron/agent/rpc.py b/neutron/agent/rpc.py index 6b725974c5d..5d203bb51a6 100644 --- a/neutron/agent/rpc.py +++ b/neutron/agent/rpc.py @@ -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) diff --git a/neutron/conf/common.py b/neutron/conf/common.py index e57917e73b7..1209a9d0633 100644 --- a/neutron/conf/common.py +++ b/neutron/conf/common.py @@ -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.')), ] diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 16a5a6c9c0f..509469b9775 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -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): diff --git a/neutron/tests/unit/agent/test_rpc.py b/neutron/tests/unit/agent/test_rpc.py index b595822fd8b..6c61814ed28 100644 --- a/neutron/tests/unit/agent/test_rpc.py +++ b/neutron/tests/unit/agent/test_rpc.py @@ -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): diff --git a/releasenotes/notes/remove-live_migration_events-f9dd9eacfdf32f97.yaml b/releasenotes/notes/remove-live_migration_events-f9dd9eacfdf32f97.yaml new file mode 100644 index 00000000000..c5efcb9ad12 --- /dev/null +++ b/releasenotes/notes/remove-live_migration_events-f9dd9eacfdf32f97.yaml @@ -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 `_. diff --git a/zuul.d/tempest-multinode.yaml b/zuul.d/tempest-multinode.yaml index 05f5a3cbc87..ecf9f922094 100644 --- a/zuul.d/tempest-multinode.yaml +++ b/zuul.d/tempest-multinode.yaml @@ -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