forked from docker-archive-public/docker.machine
-
Notifications
You must be signed in to change notification settings - Fork 132
Retry graceful shutdown on vSphere VM deletion until timeout #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
- Retry graceful shutdown initiation until GracefulShutdownTimeout is met - Track total elapsed time for both retry attempts and waiting for shutdown completion - If graceful shutdown can't be initiated within timeout, proceed to hard power off - Improved logging to distinguish between failed initiation attempts and successful shutdown Co-authored-by: snasovich <[email protected]>
- Test validates that timeout accepts 0 and positive values - Test validates that negative timeout values are rejected - Ensures existing validation logic is maintained Co-authored-by: snasovich <[email protected]>
- Sleep before incrementing elapsed time for accurate timing - Ensures elapsed time accurately reflects actual waiting time - Second loop properly uses remaining timeout from first loop Co-authored-by: snasovich <[email protected]>
All changes complete and validated: - Retry logic properly implemented with accurate timing - Tests pass successfully - Code review completed and issues addressed - Security scan passed with no alerts Co-authored-by: snasovich <[email protected]>
Co-authored-by: snasovich <[email protected]>
Copilot
AI
changed the title
[WIP] Update logic for graceful shutdown of vSphere nodes
Retry graceful shutdown on vSphere VM deletion until timeout
Dec 22, 2025
|
@copilot please update the description based on the latest changes pushed to the branch |
Author
680b751 to
d1517d4
Compare
jiaqiluo
approved these changes
Jan 14, 2026
Member
jiaqiluo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
HarrisonWAffel
approved these changes
Jan 14, 2026
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.
During vSphere VM deletion, if
vm.ShutdownGuest()fails on first attempt (VMware Tools not ready, transient API failure), the entire deletion fails. After 3 retries, Rancher abandons the deletion leaving orphaned VMs.Changes
Unified retry loop with precise timing:
time.Now()and deadline-based timing for accuracyd.Stop()untilGracefulShutdownTimeoutis reachedTimeout tracking:
time.Since()to track elapsed time from startGracefulShutdownTimeoutFallback behavior:
d.Kill()(hard power off) if graceful shutdown can't be initiated within timeoutBefore:
After:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.