Visitar URL original
Use persistent Logical Switch Ports with OVN by stgraber · Pull Request #3587 · lxc/incus · GitHub
Skip to content

Use persistent Logical Switch Ports with OVN - #3587

Merged
stgraber merged 9 commits into
lxc:mainfrom
stgraber:ovn
Jul 6, 2026
Merged

stgraber merged 9 commits into
lxc:mainfrom
stgraber:ovn

Conversation

@stgraber

@stgraber stgraber commented Jul 5, 2026

Copy link
Copy Markdown
Member

Up until now Incus would create and delete OVN ports at every NIC device start/stop event.

This would keep OVN looking very clean with only active instances getting database records, but it also comes with some annoying downsides.

The main one being that when using dynamic allocation, restarting a bunch of instance makes it unlikely that they'll all get their previous IP back. Incus has a volatile key to try to restore those addresses on a best-effort basis but when dealing with a large amount of instances coming up at once, a bunch are bound to change addresses.

Instead, we're now keeping an OVN LSP for the instance's lifetime but marking it as disabled when the instance is stopped.

Comment thread internal/server/network/driver_ovn.go Resolved
stgraber added 9 commits July 6, 2026 09:17
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
This handles upgrading from the current setup where the port will be
missing on a clean start as well as make Incus tolerant to
missing/deleted switch ports in the future.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: Magalu Cloud (https://magalu.cloud)
@stgraber
stgraber enabled auto-merge July 6, 2026 13:20
@stgraber
stgraber merged commit 7d65db4 into lxc:main Jul 6, 2026
158 of 161 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