[backport v2.14] Adds retry logic for reserved NICs during cleanup#495
Merged
apoorvajagtap merged 1 commit intoJul 9, 2026
Merged
Conversation
Handle Azure NIC reservation during VM deletion
There was a problem hiding this comment.
Pull request overview
Adds retry logic to improve Azure NIC cleanup when deletion fails due to temporary NicReservedForAnotherVm reservations, reducing the likelihood of orphaned networking resources.
Changes:
- Detect
NicReservedForAnotherVmduring NIC cleanup and trigger a retry path. - Add an exponential backoff retry loop with context-aware waiting/cancellation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
backport issue: ranher/rancher#55992 |
HarrisonWAffel
approved these changes
Jul 9, 2026
HarrisonWAffel
left a comment
There was a problem hiding this comment.
Matches the 2.15 changes. Somewhat agree with returning the error as stated in https://github.com/rancher/machine/pull/495/changes#r3551389200, but since this is a backport it could be handled later if needed
jakefhyde
approved these changes
Jul 9, 2026
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.
Issue: rancher/rancher#55992
Azure may temporarily retain NIC reservations after VM deletion or failed VM provisioning, causing cleanup to fail with the
NicReservedForAnotherVmerror.This commit:
Implements exponential backoff retry for reserved NIC deletion (5s initial, capped at 180s total).
Handles context cancellation during wait periods
This improves cleanup reliability by preventing orphaned NICs and, consequently, orphaned Public IPs.
Test Validation:
To Reproducesection on the issue.