Skip to content

incusd/network/ovn: Tweak port removal logic#2600

Merged
tych0 merged 1 commit intolxc:mainfrom
stgraber:main
Oct 31, 2025
Merged

incusd/network/ovn: Tweak port removal logic#2600
tych0 merged 1 commit intolxc:mainfrom
stgraber:main

Conversation

@stgraber
Copy link
Copy Markdown
Member

We used to rely on the DNS record existing to know whether a given instance was the original owner of an IPv4 address or was a secondary owner (as in causing a conflict), then only the primary would cause the deletion of the DNS record and IP allocation.

A recent bugfix changed the DNS logic to always release the allocation when the logical switch port goes away as we'd otherwise end up breaking OVN's ability to generate DNS records in the Southbound database.

That bugfix then effectively broke the logic around IP reservations by making it such that if two instances are conflicting, deleting the first one and then the second one leads to a ghost IP allocation preventing that address from being used again.

The fix here is to have the NIC perform the usual address conflict check and then pass on that result to the port remove logic so the OVN function can clear the IP allocation if no conflict exists but retain it otherwise.

This issue was discovered through our automated daily OVN tests.

We used to rely on the DNS record existing to know whether a given
instance was the original owner of an IPv4 address or was a secondary
owner (as in causing a conflict), then only the primary would cause the
deletion of the DNS record and IP allocation.

A recent bugfix changed the DNS logic to always release the allocation
when the logical switch port goes away as we'd otherwise end up breaking
OVN's ability to generate DNS records in the Southbound database.

That bugfix then effectively broke the logic around IP reservations by
making it such that if two instances are conflicting, deleting the first
one and then the second one leads to a ghost IP allocation preventing
that address from being used again.

The fix here is to have the NIC perform the usual address conflict check
and then pass on that result to the port remove logic so the OVN
function can clear the IP allocation if no conflict exists but retain it
otherwise.

This issue was discovered through our automated daily OVN tests.

Signed-off-by: Stéphane Graber <[email protected]>
@tych0 tych0 merged commit 5e08136 into lxc:main Oct 31, 2025
71 of 72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants