Bug 2039782 - [RHOSP 16.2] [OVN] static routes not removed from ovn db when running neutron router-update --no-routes even when the revision number is updated
Summary: [RHOSP 16.2] [OVN] static routes not removed from ovn db when running neutron...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-networking-ovn
Version: 16.2 (Train)
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: z2
: 16.2 (Train on RHEL 8.4)
Assignee: Arnau Verdaguer
QA Contact: Eran Kuris
URL:
Whiteboard:
Depends On: 2039653
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-12 12:46 UTC by Punit Kundal
Modified: 2022-07-04 09:42 UTC (History)
10 users (show)

Fixed In Version: python-networking-ovn-7.4.2-2.20220113214852.a2eba10.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2039653
Environment:
Last Closed: 2022-03-23 22:12:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-12105 0 None None None 2022-01-12 12:49:13 UTC
Red Hat Product Errata RHBA-2022:1001 0 None None None 2022-03-23 22:13:29 UTC

Description Punit Kundal 2022-01-12 12:46:01 UTC
+++ This bug was initially created as a clone of Bug #2039653 +++

Description of problem:

when trying to remove static routes from a neutron router with neutron router-update --no-routes; those are not removed from ovn db

+++
(overcloud) [stack@undercloud16 ~]$ neutron router-update 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def --routes type=dict list=true destination=172.28.4.0/24,nexthop=192.168.38.117
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Updated router: 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def
(overcloud) [stack@undercloud16 ~]$ neutron router-show router2
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+-------------------------+---------------------------------------------------------------+
| Field                   | Value                                                         |
+-------------------------+---------------------------------------------------------------+
| admin_state_up          | True                                                          |
| availability_zone_hints |                                                               |
| availability_zones      |                                                               |
| created_at              | 2022-01-10T12:21:00Z                                          |
| description             |                                                               |
| external_gateway_info   |                                                               |
| id                      | 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def                          |
| name                    | router2                                                       |
| project_id              | fdcae2d77d574c88bf043c4eec59e14e                              |
| revision_number         | 4                                                             |
| routes                  | {"destination": "172.28.4.0/24", "nexthop": "192.168.38.117"} |
| status                  | ACTIVE                                                        |
| tags                    |                                                               |
| tenant_id               | fdcae2d77d574c88bf043c4eec59e14e                              |
| updated_at              | 2022-01-11T14:37:10Z                                          |
+-------------------------+---------------------------------------------------------------+

[root@overcloud-novacompute-0 ~]# ovn-nbctl lr-route-list neutron-1472ea21-f3e7-41a8-aad5-ab2fcf6f6def
IPv4 Routes
            172.28.4.0/24            192.168.38.117 dst-ip
[root@overcloud-novacompute-0 ~]# 

(overcloud) [stack@undercloud16 ~]$ neutron router-update 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def --no-routes
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Updated router: 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def
(overcloud) [stack@undercloud16 ~]$ neutron router-show 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | True                                 |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2022-01-10T12:21:00Z                 |
| description             |                                      |
| external_gateway_info   |                                      |
| id                      | 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def |
| name                    | router2                              |
| project_id              | fdcae2d77d574c88bf043c4eec59e14e     |
| revision_number         | 5                                    |
| routes                  |                                      |
| status                  | ACTIVE                               |
| tags                    |                                      |
| tenant_id               | fdcae2d77d574c88bf043c4eec59e14e     |
| updated_at              | 2022-01-11T14:40:38Z                 |
+-------------------------+--------------------------------------+
(overcloud) [stack@undercloud16 ~]$ 

[root@overcloud-novacompute-0 ~]# ovn-nbctl lr-route-list neutron-1472ea21-f3e7-41a8-aad5-ab2fcf6f6def
IPv4 Routes
            172.28.4.0/24            192.168.38.117 dst-ip
[root@overcloud-novacompute-0 ~]# 


[root@overcloud-novacompute-0 ~]# ovn-nbctl list Logical_Router
_uuid               : 48f976d9-885c-46f3-bbc9-929d33b6b61d
enabled             : true
external_ids        : {"neutron:availability_zone_hints"="", "neutron:gw_port_id"="", "neutron:revision_number"="5", "neutron:router_name"=router2}
load_balancer       : []
name                : neutron-1472ea21-f3e7-41a8-aad5-ab2fcf6f6def
nat                 : []
options             : {}
policies            : []
ports               : [08302ddd-ec72-4351-a66d-aa91247f3a25, c3fd3b3b-bf3e-43b5-86ca-877eea6d313e]
static_routes       : [cbdc77f5-9275-434a-9e20-c004e03042c3]
+++

it is noticed that the revision number is updated in ovn db for the object

If we then try to run neutron-ovn-db-sync-util we can clearly see in the logs the route is being removed from api:

+++
[root@overcloud-controller-0 ~]# podman exec neutron_api neutron-ovn-db-sync-util --config-file /usr/share/neutron/neutron-dist.conf --config-dir /usr/share/neutron/server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-server --log-file=/var/log/neutron/repair.log --ovn-neutron_sync_mode repair
+++

this is noticed from the logs:

+++
2022-01-11 15:05:05.486 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Updating networks on router port aebff348-6c59-4036-a4f9-8b81ff4dd301 in OVN NB DB
2022-01-11 15:05:05.647 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Router Port port_id=13e6dbce-6fc6-47cb-a0de-9a10a54d02bd needs to be updated for networks changed
2022-01-11 15:05:05.648 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Updating networks on router port 13e6dbce-6fc6-47cb-a0de-9a10a54d02bd in OVN NB DB
2022-01-11 15:05:05.824 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Router Port port_id=0ed5807b-fefc-4269-9ac0-8fd6f4a380b5 needs to be updated for networks changed
2022-01-11 15:05:05.824 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Updating networks on router port 0ed5807b-fefc-4269-9ac0-8fd6f4a380b5 in OVN NB DB
2022-01-11 15:05:05.998 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Router Port port_id=ce5a9f7e-2823-45c6-bfba-8344a1e57d9c needs to be updated for networks changed
2022-01-11 15:05:05.998 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Updating networks on router port ce5a9f7e-2823-45c6-bfba-8344a1e57d9c in OVN NB DB
2022-01-11 15:05:06.174 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Router 1472ea21-f3e7-41a8-aad5-ab2fcf6f6def static routes [{'destination': '172.28.4.0/24', 'nexthop': '192.168.38.117'}] found in OVN but not in Neutron
2022-01-11 15:05:06.174 427799 WARNING networking_ovn.ovn_db_sync [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Delete static routes [{'destination': '172.28.4.0/24', 'nexthop': '192.168.38.117'}] from OVN NB DB
2022-01-11 15:05:06.182 427799 INFO networking_ovn.cmd.neutron_ovn_db_sync_util [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Sync completed for Northbound db
2022-01-11 15:05:06.182 427799 INFO networking_ovn.cmd.neutron_ovn_db_sync_util [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Sync for Southbound db started with mode : repair
2022-01-11 15:05:06.543 427799 INFO networking_ovn.cmd.neutron_ovn_db_sync_util [req-716a2187-0f7d-4bb3-8eb7-8282956788e7 - - - - -] Sync completed for Southbound db
+++

the other workaround appears to be ovn-nbctl

Version-Release number of selected component (if applicable):
[root@overcloud-controller-0 ~]# podman exec -it ovn_controller rpm -qa | grep -e neutron -e ovn 
puppet-neutron-15.5.1-1.20210323133456.7d0406b.el8ost.noarch
ovn2.13-20.12.0-135.el8fdp.x86_64
rhosp-ovn-host-2.13-12.el8ost.noarch
puppet-ovn-15.4.1-1.20201113171358.192ac4e.el8ost.noarch
rhosp-ovn-2.13-12.el8ost.noarch
ovn2.13-host-20.12.0-135.el8fdp.x86_64
[root@overcloud-controller-0 ~]# cat /etc/rhosp-release 
Red Hat OpenStack Platform release 16.1.6 GA (Train)
[root@overcloud-controller-0 ~]# 


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Daniel Alvarez Sanchez on 2022-01-12 10:03:32 UTC ---

Thanks Punit.

This issue is fixed upstream: https://review.opendev.org/c/openstack/neutron/+/708009
The launchpad bug is: https://bugs.launchpad.net/neutron/+bug/1860273

I see that the code is missing in 16.2 as well.
Please, clone this BZ to 16.2 and we'll backport https://review.opendev.org/c/openstack/neutron/+/708009 to both

Comment 9 errata-xmlrpc 2022-03-23 22:12:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 16.2.2), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1001


Note You need to log in before you can comment on or make changes to this bug.