Skip to content

[backport v2.14] Adds retry logic for reserved NICs during cleanup#495

Merged
apoorvajagtap merged 1 commit into
rancher:release/v2.14from
apoorvajagtap:8916-214-backport
Jul 9, 2026
Merged

[backport v2.14] Adds retry logic for reserved NICs during cleanup#495
apoorvajagtap merged 1 commit into
rancher:release/v2.14from
apoorvajagtap:8916-214-backport

Conversation

@apoorvajagtap

@apoorvajagtap apoorvajagtap commented Jul 9, 2026

Copy link
Copy Markdown

Issue: rancher/rancher#55992

Azure may temporarily retain NIC reservations after VM deletion or failed VM provisioning, causing cleanup to fail with the NicReservedForAnotherVm error.

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:

  • Please refer To Reproduce section on the issue.

Handle Azure NIC reservation during VM deletion

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NicReservedForAnotherVm during 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.

Comment thread drivers/azure/azureutil/azureutil.go
Comment thread drivers/azure/azureutil/azureutil.go
@daviswill2

daviswill2 commented Jul 9, 2026

Copy link
Copy Markdown

backport issue: ranher/rancher#55992

@HarrisonWAffel HarrisonWAffel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@apoorvajagtap apoorvajagtap merged commit d4e7aeb into rancher:release/v2.14 Jul 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants