Conversation
Signed-off-by: Zespre Chang <zespre.chang@suse.com> (cherry picked from commit 0e8e17c)
Signed-off-by: Zespre Chang <zespre.chang@suse.com> (cherry picked from commit 356595b)
vm-controller will reflect the MAC addresses on the corresponding vmnetcfg resources. vmnetcfg-controller will sync the status with the spec, remove the stale records, update the ippool resources, and then allocate new IP addresses for the new MAC addresses. Signed-off-by: Zespre Chang <zespre.chang@suse.com> (cherry picked from commit d6a5209)
Signed-off-by: Zespre Chang <zespre.chang@suse.com> (cherry picked from commit 4369dc8)
Signed-off-by: Zespre Chang <zespre.chang@suse.com> (cherry picked from commit 0efc388)
starbops
approved these changes
Feb 24, 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.
IMPORTANT: Please do not create a Pull Request without creating an issue first.
Problem:
The Managed DHCP add-on cannot catch any changes in the virtual machine's MAC address updates. The only way to let the add-on serve IP addresses for the updated MAC addresses is to remove the corresponding VirtualMachineNetworkConfig resource and the controller will automatically create a new one with updated MAC addresses.
Solution:
Introduce a new condition in VirtualMachineNetworkConfig—
InSynced—which represents the synchronization between the VirtualMachine and VirtualMachineNetworkConfig resources, especially for the MAC addresses. The vm-controller will flag the condition and reflect the MAC addresses to the vmnetcfg resource. The vmnetcfg-controller will catch the changes, try to remove any stale records, and then update the IPPool resource. After that,InSyncedwill becomeTrue. This unblocks the regular allocation procedure, so the new MAC addresses (if any) will get new IP addresses from the IPPool resource.Related Issue:
harvester/harvester#7046
Test plan:
This is an automatic backport of pull request Reflect NICs defined in the VirtualMachine resource to the corresponding VirtualMachineNetworkConfig resource #43 done by Mergify.