An update to the OVN QoS driver to support the `qos_gateway_ip`
QoS extension [0] introduced adding the GW network id as an
external_id on the Logical_Router (LR). This is problematic
when introducing multiple gateway ports, because a single LR
can have gateways in multiple networks.
The external_id key was presumably added because at the point in
time when a LR is deleted, the code had no other source of this
information. However, it turns out this step is redundant and
not neccessary.
To prove this I include a excerpt of a stack trace when deleting
a router in the commit message:
File "services/ovn_l3/plugin.py", line 210, in delete_router super(OVNL3RouterPlugin, self).delete_router(context, id)
File "db/l3_db.py", line 612, in delete_router self._delete_current_gw_port(context, id, router, None)
File "db/l3_db.py", line 452, in _delete_current_gw_port self._core_plugin.delete_port(
File "plugins/ml2/drivers/ovn/mech_driver/mech_driver.py",
line 886, in delete_port_postcommit self._ovn_client.delete_port(context.plugin_context, port['id'],
File "plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py",
line 830, in delete_port self._delete_port(port_id, port_object=port_object)
Essentially, a routers GW port(s) will be removed prior to
deleting the router itself.
The `ovn_client.delete_port` method will call on the QoS extension
to remove rules matching the GW port, and that will be the same
rules as has previously been added for the router.
I also added a functional test that confirms this fact [1].
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/877712 /opendev. org/openstack/ neutron/ commit/ e5d4499672fe4e4 e57a24ae3194d3a daefe7be15
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit e5d4499672fe4e4 e57a24ae3194d3a daefe7be15
Author: Frode Nordahl <email address hidden>
Date: Thu Mar 16 09:48:02 2023 +0100
[ovn] Drop use of LR OVN_GW_ NETWORK_ EXT_ID_ KEY
An update to the OVN QoS driver to support the `qos_gateway_ip`
QoS extension [0] introduced adding the GW network id as an
external_id on the Logical_Router (LR). This is problematic
when introducing multiple gateway ports, because a single LR
can have gateways in multiple networks.
The external_id key was presumably added because at the point in
time when a LR is deleted, the code had no other source of this
information. However, it turns out this step is redundant and
not neccessary.
To prove this I include a excerpt of a stack trace when deleting
a router in the commit message:
File "services/ ovn_l3/ plugin. py", line 210, in delete_router
super( OVNL3RouterPlug in, self).delete_ router( context, id)
self. _delete_ current_ gw_port( context, id, router, None) current_ gw_port
self. _core_plugin. delete_ port( ml2/drivers/ ovn/mech_ driver/ mech_driver. py", port_postcommit
self. _ovn_client. delete_ port(context. plugin_ context, port['id'], ml2/drivers/ ovn/mech_ driver/ ovsdb/ovn_ client. py",
self. _delete_ port(port_ id, port_object= port_object)
File "db/l3_db.py", line 612, in delete_router
File "db/l3_db.py", line 452, in _delete_
File "plugins/
line 886, in delete_
File "plugins/
line 830, in delete_port
Essentially, a routers GW port(s) will be removed prior to
deleting the router itself.
The `ovn_client. delete_ port` method will call on the QoS extension
to remove rules matching the GW port, and that will be the same
rules as has previously been added for the router.
I also added a functional test that confirms this fact [1].
0: I46864b9234af64 f190f6b6daebfd9 4d2e3bd0c17 d08dee41974bfe3 aeb1c64b557
1: Ic92a7b3bd73920
Partial-Bug: #2002687 85df5625cd83222 799db811f2b 3e746c86a1e9d4a 6fa25496e1f
Signed-off-by: Frode Nordahl <email address hidden>
Needed-By: I95a0d5f1b7aef9
Change-Id: If7c22bc8a95fa1