Summary
The router uplink teardown leaks the dynamically allocated VLAN segment.
When a router interface is removed (or the router is deleted),
neutron_understack.routers._do_uplink_cleanup deletes the network-node
trunk subport, the OVN localnet + shared-port LSPs, and the shared neutron
port — but it never releases the dynamic VLAN segment that
fetch_or_create_router_segment allocated on the network-node physnet. The
segment (and its VLAN id) leaks on every router-interface removal / router
delete.
Component: python/neutron-understack — neutron_understack.routers
Severity: Medium — VLAN id exhaustion on the network-node physnet over time.
Reproduction
Scenario OVN-ROUTER-DETACH-01
(neutron_understack/tests/scenarios/test_router_uplink.py) asserts the
segment is released after remove_router_interface, marked
xfail(strict=True). It fails without the fix: the segment
(network_type=vlan, the network-node physnet) is still present after
teardown.
Fix direction
In _do_uplink_cleanup, after deleting the shared port, release the segment
if unused (mirroring the baremetal delete path):
release_segment_if_unused(network_segment_by_id(segment_id)). A fix branch
implementing this exists; merging it flips the strict xfail to a pass,
prompting removal of the marker.
Summary
The router uplink teardown leaks the dynamically allocated VLAN segment.
When a router interface is removed (or the router is deleted),
neutron_understack.routers._do_uplink_cleanupdeletes the network-nodetrunk subport, the OVN localnet + shared-port LSPs, and the shared neutron
port — but it never releases the dynamic VLAN segment that
fetch_or_create_router_segmentallocated on the network-node physnet. Thesegment (and its VLAN id) leaks on every router-interface removal / router
delete.
Component:
python/neutron-understack—neutron_understack.routersSeverity: Medium — VLAN id exhaustion on the network-node physnet over time.
Reproduction
Scenario
OVN-ROUTER-DETACH-01(
neutron_understack/tests/scenarios/test_router_uplink.py) asserts thesegment is released after
remove_router_interface, markedxfail(strict=True). It fails without the fix: the segment(
network_type=vlan, the network-node physnet) is still present afterteardown.
Fix direction
In
_do_uplink_cleanup, after deleting the shared port, release the segmentif unused (mirroring the baremetal delete path):
release_segment_if_unused(network_segment_by_id(segment_id)). A fix branchimplementing this exists; merging it flips the strict xfail to a pass,
prompting removal of the marker.