✨ Simplify VM create network interface provisioning#1573
Conversation
dabb8f0 to
eae2a8c
Compare
a84ddff to
5213024
Compare
| mgr.GetScheme(), | ||
| mgr.GetRESTMapper(), | ||
| &vmopv1.VirtualMachine{}, | ||
| handler.OnlyControllerOwner()), |
There was a problem hiding this comment.
is this because of old vms which didnt have controller owner?
There was a problem hiding this comment.
Kind of. The network interface CRs that we create should have always been controller refs but weren't. I fixed that recently and all VPC SubnetPorts will be controller owner refs, but I changed this for consistency with the others and just for BYO network interface support (although the precise life cycle of those are still TBD)
There was a problem hiding this comment.
Shouldn't we be patching existing objects with ControllerRefs then?
There was a problem hiding this comment.
Yes, I handled that with:
. But since in theory an existing network interface CR could already have a controller ref we can't always put ourselves as the owner.VPC was done after I fixed us to always do controller refs so that is why the prior code used that in the handler but change here to match the others.
90ff118 to
9642b98
Compare
akutz
left a comment
There was a problem hiding this comment.
Requested some feedback, but not necessarily changes. Let me know what you think.
e6763aa to
dd1d0d3
Compare
Replace blocking network interface polling with watch-based reconciliation and introduce NetworkDevice type for create flow optimizations. This is the first in several in addressing the cruft that has built up around the network interfaces. Issues in the Update path will be next. - Add CreateNetworkDevices function for VM create that creates all network interface CRs and checks readiness without polling, returning NetworkDevices containing just what is needed for the ethernet card device - Add VM controller watches for NetworkInterface, VirtualNetworkInterface, and SubnetPort so the polling can be removed. - Keep existing CreateAndWaitForNetworkInterfaces for update path that needs full NetworkInterfaceResult with bootstrap customization fields The interface CR create code is shared between the two functions. The create flow now creates all interface CRs, immediately checks readiness, and returns either devices or an error. Controller watches ensure prompt re-reconciliation when CRs become ready, eliminating the 15-second polling timeout that blocked VM creation. This will speed up creation of VMs with network interfaces. Parts of this change facilitate later work such as mixed network provider setups, and BYO network interface.
dd1d0d3 to
f6fbc86
Compare
Minimum allowed line rate is |
What does this PR do, and why is it needed?
Replace blocking network interface polling with watch-based reconciliation and introduce NetworkDevice type for create flow optimizations.
This is the first in several in addressing the cruft that has built up around the network interfaces. Issues in the Update path will be next.
The create flow now creates all interface CRs, immediately checks readiness, and returns either devices or an error. Controller watches ensure prompt re-reconciliation when CRs become ready, eliminating the 15-second polling timeout that blocked VM creation. This will speed up creation of VMs with network interfaces.
Parts of this change facilitate later work such as mixed network provider setups, and BYO network interface.
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: