feat: ops-scripts to compare kube-ovn with neutron-ovn #1362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
REF: #1342
Pull Request: Introduce Complete OVN/Neutron Consistency Check Suite (4 Scripts)
Overview
This PR introduces a complete, production-ready suite of four diagnostic and cleanup utilities to ensure consistency between the Neutron API and the OVN Northbound (NB) database.
These scripts are critical for identifying and remediating missing or stale networking resources (Ports, Security Groups, Routers, and Floating IPs) that can accumulate due to race conditions or controller failures.
Key Features (Shared Across All Scripts)
All four scripts follow a standardized structure for consistent operation, reporting, and automation:
Component Scripts and Validation Logic
ovn_compare_neutron_ports_with_ovn_lsp.sh (Ports)
Neutron Source: openstack port list (excluding FIPs).
OVN Target: Logical_Switch_Port (LSP) table.
Validation: Matches Neutron Port UUID to OVN LSP name.
Fix Action: Destroys STALE Logical_Switch_Port entries.
ovn_compare_neutron_security_groups_with_acl.sh (Security Groups)
Neutron Source: openstack security group list / rule list.
OVN Target: Port_Group and ACL tables.
Validation: Matches Neutron UUIDs to OVN external_ids.
Fix Action: Destroys STALE Port_Group and ACL entries.
ovn_compare_neutron_routers_with_logical_routers.sh (Routers)
Neutron Source: openstack router list / port list (router device owners).
OVN Target: Logical_Router and Logical_Router_Port tables.
Validation: Matches Neutron Router ID to OVN LR name (neutron-UUID) and Neutron Port ID to OVN LRP name (handles lrp- prefix).
Fix Action: Destroys STALE Logical_Router and STALE Logical_Router_Port entries.
ovn_compare_neutron_fips_with_ovn_nat.sh (Floating IPs)
Neutron Source: openstack floating ip list (Filtered for Assigned FIPs only).
OVN Target: NAT table (rules with type=dnat_and_snat).
Validation: Matches the FIP Address (external IP) to the OVN NAT rule's external_ip.
Fix Action: Destroys STALE FIP-related NAT rules.