Skip to content

router uplink dynamic VLAN segment leaked on interface removal #2245

Description

@cardoe

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-understackneutron_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions