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

Error removing attached managed disks during Terraform destroy operation #1782

Closed
doherty100 opened this issue Aug 15, 2018 · 3 comments
Closed

Comments

@doherty100
Copy link

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 Version

Terraform v0.11.8
provider.azurerm v1.8.0

Affected Resource(s)

  • azurerm_managed_disk
  • azurerm_virtual_machine_data_disk_attachment

Terraform Configuration Files

resource "azurerm_managed_disk" "external" {
    count                = "${var.number_of_disks}"
    name                 = "${var.prefix}-disk${count.index+1}"
    location             = "${azurerm_resource_group.main.location}"
    resource_group_name  = "${azurerm_resource_group.main.name}"
    storage_account_type = "Standard_LRS"
    create_option        = "Empty"
    disk_size_gb         = "10"
}

resource "azurerm_virtual_machine_data_disk_attachment" "external" {
    count              = "${var.number_of_disks}"
    managed_disk_id    = "${azurerm_managed_disk.external.*.id[count.index]}"
    virtual_machine_id = "${azurerm_virtual_machine.main.id}"
    lun                = "${10+count.index}"
    caching            = "ReadWrite"
}

Debug Output

https://1drv.ms/t/s!Amjy2JnYXyQgjasElLzPqmyZ5QUtIw

Panic Output

None

Expected Behavior

Terraform destroy operation should have completed successfully.

Actual Behavior

2 error(s) occurred:

  • azurerm_virtual_machine_data_disk_attachment.external[0] (destroy): 1 error(s) occurred:

  • azurerm_virtual_machine_data_disk_attachment.external.0: Error removing Disk "rheltest-disk1" from Virtual Machine "rheltest-vm" (Resource Group "rheltest-resources"): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Could not find member 'resources' on object of type 'ResourceDefinition'. Path 'resources', line 1, position 1453.'."

  • azurerm_virtual_machine_data_disk_attachment.external[1] (destroy): 1 error(s) occurred:

  • azurerm_virtual_machine_data_disk_attachment.external.1: Error removing Disk "rheltest-disk2" from Virtual Machine "rheltest-vm" (Resource Group "rheltest-resources"): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Could not find member 'resources' on object of type 'ResourceDefinition'. Path 'resources', line 1, position 1453.'."

Steps to Reproduce

  1. Create a configuration using https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/virtual-machines/managed-disks/attaching-external-disks
  2. Terraform apply
  3. Terraform destroy

Important Factoids

None

References

  • N/A
@tombuildsstuff
Copy link
Contributor

Hey @doherty100

Thanks for opening this issue.

This has previously been reported in #1600 - rather than having multiple issues open tracking the same thing I'm going to close this in favour of #1600 - would you mind subscribing to that for updates?

Thanks!

@doherty100
Copy link
Author

No problem, I did a search prior to filing but didn't find #1600.

@tombuildsstuff tombuildsstuff added the service/disk-attachments Virtual Machine Disk Attachments label Dec 10, 2018
@ghost
Copy link

ghost commented Mar 5, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants