From a83d1bf5ae201a10e6faf06dd94cbf2860ecf53f Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Fri, 1 May 2020 14:33:16 +0000 Subject: [PATCH] Remove OVN floating IP deletion of associated LSP When a floating IP is created or updated, and a router is defined, a NAT rule is created in OVN NB. There is not logical switch port associated to a floating IP, that means there is no need to remove any LSP associated. Change-Id: Icaf04f0b9184c153fa6b3fe218c889fd5684b3f0 --- .../ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py | 10 ---------- neutron/tests/unit/services/ovn_l3/test_plugin.py | 6 ------ 2 files changed, 16 deletions(-) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py index f94ba8208a7..eaa34e10820 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py @@ -741,16 +741,6 @@ class OVNClient(object): admin_context, floatingip['id']) gw_lrouter_name = utils.ovn_name(router_id) - # TODO(chandrav): Since the floating ip port is not - # bound to any chassis, packets destined to floating ip - # will be dropped. To overcome this, delete the floating - # ip port. Proper fix for this would be to redirect packets - # destined to floating ip to the router port. This would - # require changes in ovn-northd. - commands.append(self._nb_idl.delete_lswitch_port( - fip_db['floating_port_id'], - utils.ovn_name(floatingip['floating_network_id']))) - ext_ids = { ovn_const.OVN_FIP_EXT_ID_KEY: floatingip['id'], ovn_const.OVN_REV_NUM_EXT_ID_KEY: str(utils.get_revision_number( diff --git a/neutron/tests/unit/services/ovn_l3/test_plugin.py b/neutron/tests/unit/services/ovn_l3/test_plugin.py index ac30228d337..79067dfc015 100644 --- a/neutron/tests/unit/services/ovn_l3/test_plugin.py +++ b/neutron/tests/unit/services/ovn_l3/test_plugin.py @@ -895,8 +895,6 @@ class TestOVNL3RouterPlugin(test_mech_driver.Ml2PluginV2TestCase): logical_ip='10.0.0.10', external_ip='192.168.0.10', external_ids=expected_ext_ids) - self.l3_inst._ovn.delete_lswitch_port.assert_called_once_with( - 'fip-port-id', 'neutron-fip-net-id') def test_create_floatingip_distributed(self): self.l3_inst._ovn.is_col_present.return_value = True @@ -966,8 +964,6 @@ class TestOVNL3RouterPlugin(test_mech_driver.Ml2PluginV2TestCase): logical_ip='10.0.0.10', external_ip='192.168.0.10', external_ids=expected_ext_ids) - self.l3_inst._ovn.delete_lswitch_port.assert_called_once_with( - 'fip-port-id', 'neutron-fip-net-id') def test_create_floatingip_external_ip_present_type_snat(self): self.l3_inst._ovn.is_col_present.return_value = True @@ -990,8 +986,6 @@ class TestOVNL3RouterPlugin(test_mech_driver.Ml2PluginV2TestCase): logical_ip='10.0.0.10', external_ip='192.168.0.10', external_ids=expected_ext_ids) - self.l3_inst._ovn.delete_lswitch_port.assert_called_once_with( - 'fip-port-id', 'neutron-fip-net-id') def test_create_floatingip_lsp_external_id(self): foo_lport = fake_resources.FakeOvsdbRow.create_one_ovsdb_row()