fix(vmwarevsphere): use WaitForIP instead of WaitForNetIP to fix hang with multiple NICs#367
Open
scheidet wants to merge 1 commit intorancher:masterfrom
Open
Conversation
…ng with multiple NICs WaitForNetIP blocks until ALL NICs report an IP address via guest.net, which causes an indefinite hang when a VM has multiple network adapters but only one of them has a DHCP server. This is a common setup where a secondary NIC is used for internal/storage traffic with no DHCP. WaitForIP watches guest.ipAddress (the primary IP reported by VMware Tools) and completes as soon as any IPv4 address is available, making it the correct choice for retrieving the machine's reachable IP. Also removes the len(ips) >= 0 check that was always true and could lead to an index-out-of-bounds on an empty slice. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
another bug here is, when you try delete machine, has a job deendency in a queue and you can not go on and never go back, you are in stuck scenarious. |
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.
Problem
When a node pool is configured with two network interfaces, machine creation hangs indefinitely at:
Root cause
GetIP()callsvm.WaitForNetIP(ctx, false)(govmomi), which monitors theguest.netproperty and only returns when all NICs have reported an IP address:This hangs when the VM has multiple network adapters but only one has a DHCP server — a common setup where a secondary NIC is used for storage or internal traffic with no DHCP. VMware Tools reports the primary IP in vCenter, but
WaitForNetIPnever completes because the second NIC has no IP.Fix
Replace
WaitForNetIPwithWaitForIP, which monitorsguest.ipAddress(the primary IPv4 address reported by VMware Tools) and returns as soon as one IPv4 address is available, regardless of how many NICs the VM has.This also removes a
len(ips) >= 0check that was always true (slice length is never negative) and could mask an empty-slice index panic.Test