-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Cancel RollingUpgrades before deleting VMSS resources #15634
Cancel RollingUpgrades before deleting VMSS resources #15634
Conversation
…t sas token post disk operations
…com/harshavmb/terraform-provider-azurerm into vmss-rollingupgrades-cancel-destroy
…t sas token post disk operations
…com/harshavmb/terraform-provider-azurerm into vmss-rollingupgrades-cancel-destroy
Finally apologies for these commits originated from my |
Hi @tombuildsstuff @katbyte @jackofallops , Could you please provider some update on this PR? Waiting in the review queue for quite sometime. |
…r-azurerm into vmss-rollingupgrades-cancel-destroy
…r-azurerm into vmss-rollingupgrades-cancel-destroy
This comment was marked as off-topic.
This comment was marked as off-topic.
Hello, This PR will fix a known and real limitation when working with Azure VM scale sets in Terraform. Meanwhile, it is blocking the development of our Terraform-based automation. Is there any chance to have it considered? It was submitted a long time ago and there has not been any movement for a while. |
closing in favour of #18973 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
RollingUpgrades when setup on VM ScaleSets cause lot of problems during destroy. This gets worse when extensions are run on these scalesets.
At the moment, we use destroy provisioners, to cancel rolling upgrades & then destroy resources such as extensions & VMSS.
This tiny boolean flag
cancel_rolling_upgrades_before_deletion
when set totrue
will cancel rolling upgrades if they are running and then move forward to delete the VMSS. This way, we avoid writing destroy provisioners.In addition to this, the logic in helpers.go file,
future.Response().StatusCode == http.StatusConflict && strings.Contains(err.Error(), "There is no ongoing Rolling Upgrade to cancel.")
is to handle a scenario on a newly provisioned VMSS resource where rolling upgrades are set but no extensions, auto-scaling are run.The error parsing logic is to handle the error thrown by Azure API when no Rolling Upgrades are ongoing.
Get-Latest API URL ::
https://management.azure.com/subscriptions/{subId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmSSName}/rollingUpgrades/latest?api-version=2021-07-01
In other cases, we cancel, wait until the cancel is complete & move ahead to delete the resource associated with VMSS.
Have compiled & tested locally, it works as expected.
Hope this helps!