Skip to content
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

getting too often RetryableError while VM provisioning #11257

Open
JustLeo opened this issue Apr 8, 2021 · 4 comments
Open

getting too often RetryableError while VM provisioning #11257

JustLeo opened this issue Apr 8, 2021 · 4 comments

Comments

@JustLeo
Copy link

JustLeo commented Apr 8, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

  • Terraform v0.12.26
  • provider.azurerm 2.46.0

Affected Resource(s)

  • azurerm_virtual_machine
  • azurerm_XXXXX

Terraform Configuration Files

provider "azurerm" {
 version = "=2.46.0"
 features {}
}

resource "azurerm_virtual_machine" "node-newnode01" {
name                  = "newnode01"
 location            = azurerm_resource_group.azurerm_resource_group.location
 resource_group_name = azurerm_resource_group.azurerm_resource_group.name
     network_interface_ids = [azurerm_network_interface.newnode01-nic-lan.id]
     vm_size               = "Standard_D2_v2"
     delete_os_disk_on_termination = true 
 os_profile {
   computer_name  = "newnode01"
   admin_username = "admin_user"
   admin_password = "SOME_PASSOWRD"
 } 
storage_image_reference {
   id = data.azurerm_image.search_my_image.id
}
storage_os_disk {
          name              = "newnode01_osdisk"
          create_option     = "FromImage"
          caching           = "ReadWrite"
          managed_disk_type = "Standard_LRS"
          disk_size_gb      = 160
         }
 tags = {
  ...
 }
     os_profile_windows_config {
       provision_vm_agent = true
     }
 depends_on = [azurerm_subnet.azure_subnets,azurerm_network_interface.newnode01-nic-lan]
}
data "azurerm_image" "search_my_image" { 
  name                = "IMAGE_NAME"
    resource_group_name = "IMAGE_RG"
}

Debug Output

Panic Output

Expected Behaviour

VM should be provisioned with no error. This error doesn't happend every time, it's intermittent but I would like to get rid of it.

Actual Behaviour

VM is getting provisioned with below error message:

Additional error information is available for this virtual machine:
GENERAL
Provisioning state Provisioning failed.
A retryable error occurred..
RetryableError
Provisioning state error code ProvisioningState/failed/RetryableError
Guest agent Unknown
DISKS
azunomutaimad01_osdisk Provisioning succeeded.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@JustLeo JustLeo changed the title gettin too often RetryableError while VM provisioning getting too often RetryableError while VM provisioning Apr 8, 2021
@ekristen
Copy link

ekristen commented Jul 7, 2022

I have seen this to. I've seen it happen right after reporting success, then not recording the VM in state, even though it exist. It also seems to fail pretty quick like it is not retrying to retryable error. Anecdotally, reducing parallelism to 5 seems to help prevent the issue, however I can't say it resolves it entirely.

@alexmunda
Copy link

alexmunda commented Jul 11, 2022

We are seeing this error often when creating a VM/attaching a disk to a VM using the azurerm_virtual_machine_data_disk_attachment resource. Retrying the Terraform run results in the following error:

A resource with the ID "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Compute/virtualMachines/xxx/dataDisks/xxx" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_virtual_machine_data_disk_attachment" for more information.

Based on this it kinda seems like the retry needs to happen at the resource level since Azure is returning a 200 in this case (from #5502 (comment)) and expecting the caller to poll until the state is good. I can PR this if there is consensus that this is the appropriate solution 😄

@jaredbrogan
Copy link
Contributor

Still seeing this on AzureRM 3, so not just a legacy issue.

@magodo
Copy link
Collaborator

magodo commented Nov 26, 2024

Similar to #21293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants