incusd/network/ovn: Tweak port removal logic#2600
Merged
Conversation
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
approved these changes
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.