-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Network: Switch to long-lived OVN ports (#13900)
- [x] Convert OVN logical switch ports and associated config to be created at NIC create time and deleted at NIC delete time (rather than start and stop time respectively). - [x] Update tests to reflect this. See canonical/lxd-ci#261 - [x] Add DB patch to clear out `volatile.*last_state.ip_addresses` instance config entries as no longer needed. - [x] Explore if we can have a network level option to allow the OVN dynamic IPs to be refreshed on start and cleared on stop to allow the old dynamic behaviour as well, otherwise it won't be possible to create more instances than available IPs, even if not all of them are running at the same time. - [x] Test live VM migration works - tested using both ceph and zfs migrations. Confirmed that creating an OVN NIC when there is insufficient space causes an error: ``` Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed to add device "eth0": Failed setting up OVN port: Insufficient dynamic addresses allocated ``` WRT to exploring if we can later add a network option to allow dynamic allocation at start time rather than create time, this should be possible to do by not setting the `dynamic` option when we create the port, but instead setting it at start time and removing it at stop time. **But will not add this functionality in this PR.** E.g. ``` sudo ovn-nbctl find logical_switch_port addresses : ["00:16:3e:24:9c:4c"] dhcpv4_options : 592a6788-4c73-4773-a8fa-12808377eccf dhcpv6_options : 52436e24-f9d1-4436-9de4-96a264739aed dynamic_addresses : [] enabled : [] external_ids : {lxd_location=none, lxd_switch=lxd-net14-ls-int} ha_chassis_group : [] name : lxd-net14-instance-3dd0d44c-f72f-4981-b04c-bdf6414e0bba-eth0 options : {} parent_name : [] port_security : [] tag : [] tag_request : [] type : "" up : false ``` And then: ``` sudo ovn-nbctl lsp-set-addresses lxd-net14-instance-3dd0d44c-f72f-4981-b04c-bdf6414e0bba-eth0 00:16:3e:24:9c:4c dynamic ``` Will result in dynamic IPs being allocated: ``` addresses : ["00:16:3e:24:9c:4c", dynamic] dynamic_addresses : "be:af:33:b8:e5:03 10.184.229.2 fd42:843c:cb92:3d28:bcaf:33ff:feb8:e503" ``` Then removing `dynamic`: ``` sudo ovn-nbctl lsp-set-addresses lxd-net14-instance-3dd0d44c-f72f-4981-b04c-bdf6414e0bba-eth0 00:16:3e:24:9c:4c ``` Causes the dynamic IPs to be removed too: ``` addresses : ["00:16:3e:24:9c:4c"] dynamic_addresses : [] ``` It would also need the DNS setup to be delayed until NIC start time and have it torn down at NIC stop time as otherwise we won't have IPs to associate to the DNS name.
- Loading branch information
Showing
6 changed files
with
161 additions
and
202 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.