3

I've been trying to create an Azure virtual machine scale set with terraform and it's creating it fine, but when I try to perform Terraform destroy, I receive this message below. Any ideas on how I could solve this issue?

Error: Error waiting for completion of Load Balancer "vmss-see-d-01-LB" (Resource Group "RG-VMSS-D-SEE-01"):
    Code="Canceled"
    Message="Operation was canceled."
    Details=[{
        "code":"CanceledAndSupersededDueToAnotherOperation",
        "message":"Operation PutLoadBalancerOperation (81ab2118-37e3-4552-a2f7-e1e12bccb1e5) was canceled and superseded by operation InternalOperation (1d4e2e27-f457-4941-b3b8-e6352f84ddd1)."
    }]
janw
  • 8,758
  • 11
  • 40
  • 62
user3573246
  • 125
  • 1
  • 6

1 Answers1

0

As the error shows, you must put the virtual machine scale set behind a Load Balancer. While the VMSS was in the backend pool of the load balancer, and you also create a nat rule or load balancer for it, then there are dependencies between the VMSS and the Load Balancer: the Load Balancer depends on the VMSS. So if you want to delete the VMSS directly, then the error comes.

So the right sequence to delete the VMSS is that delete the nat rule or the load balancer rule associated with the VMSS, then remove the VMSS from the backend pool of the load balancer. When all the above steps are finished. The last step is deleting the VMSS.

Hope it can help you understand why does the error happen to you.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39