-
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
azurerm_virtual_machine_data_disk_attachment attach fails for more than 1 disks. #1600
Comments
Hi @sukhmeet Thanks for opening this issue :) So that we can take a look into this - is it possible for you to provide us with the Terraform configuration that you’re seeing this error with? Thanks! |
Hi Tom,
I destroyed the resources. I am reproducing it now and I will send you the details ASAP.
Do you want to see the code meanwhile ?
…Sent from my iPhone
On Jul 18, 2018, at 11:29 AM, Tom Harvey ***@***.***> wrote:
Hi @sukhmeet
Thanks for opening this issue :)
So that we can take a look into this - is it possible for you to provide us with the Terraform configuration that you’re seeing this error with?
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Tom, Virtual Machines
|
@tombuildsstuff any updates on this? is there any more information needed for this. |
I am able to use the disk attachment, but upon deletion in terraform I am getting the same error. I can get around it by using |
I've taken a quick look into this but have been unable to repro this issue directly - that said digging into this I've noticed this comment from @marstr in this issue. Based on this information I've pushed a branch Thanks! |
I've opened #1855 which includes the fix from this branch since the tests pass and that's the only inconsistency I can see between the Data Disk Attachment resource and the other VM interactions |
FWIW I was just hit by the same issue when adding a data disk through the azurerm_virtual_machine_data_disk_attachment resource type to existing VMs that have OS disks created from vhd images (I tried but gave up on trying to get managed OS disks created from packer vhd to work).
Full config snippets:
|
I'm also encountering this issue. I'm attaching 16 disks. The problem affects attachments at random, and then I'm unable to tf destroy the resource due to that error. Would it matter if I changed the parallelism? When will .14 be available? I am using .13 but still seeing this problem. |
@tombuildsstuff how do I specify my provider to use the vm-data-disk-attachment branch? thanks |
hey @sukhmeet @pabowers @perbergland @stonefury Just to let you know that this has been released in v1.14.0 of the AzureRM Provider which is now available: https://github.com/terraform-providers/terraform-provider-azurerm/blob/v1.14.0/CHANGELOG.md Thanks! |
Awesome @tombuildsstuff. Trying it right now. Really, thank you for pushing this out. |
@tombuildsstuff I seem to still have the issue with attaching disks and I just had my destroy operation fail with the same operation. But re-running the tf plan cleaned up the ones that bombed, which is OK, at least a re-run cleaned it. So here is my take on the error seen when attaching data disks. I have perhaps a special case, I am spinning up VMs with SQL server on them, and I am installing SqlIaasExtension. It seems like I must make this a dependency on my entire VM. Only when it's created and all disks are attached should I apply the extension. My suspicion is if the extension is applied while the data disks are being attached, then it creates that error condition. In my case I am applying 15+ disks, so it takes quite a while and gives enough time for this to happen.
I can put my code up on github soon so the problem can be reproduced. I would really like to know how this works for everyone else, just to make sure I'm not making some stupid mistake. terraform --version does show me 1.14.0. :) |
https://github.com/stonefury/terraform-azure-vm Run the example.tf, it will fail. See what you think. thanks |
Having a similar problem as @stonefury , I am destroying a VM with a data disk attachment, I am now using 1.14.0 as well and still get the error on first destroy, I get this error.
I am also running a azurerm_virtual_machine_extension resource that pushes a powershell script via a template_file resource publisher = "Microsoft.Compute" first pass at destroy fails, second one works. |
@jamespatetz - so I'm getting a stable deployment now, because I am not applying the extension until all the disks are attached. I am calling a module which is creating my attachments, so I use depends_on =[] to ensure the extension is applied AFTER all disks are attached. This is a subtle problem. Now, as for destroy, I'm not sure. I got a failure on destroy yesterday but not today. Maybe my dependency option also fixes that during destroy. Destroy is less of a concern for me though, I can deal with that if I just need to re-run destroy. My issue was a very hard-stuck problem with the VM where re-runs of apply failed every time. So try my suggestion and let me know how it goes. See my github link above with the depends example if you haven't used this option before. cheers |
@tombuildsstuff I am facing issue with Destroying the disk. |
@stonefury thanks for the repro - I've re-opened this for the moment |
hey @stonefury Thanks for the repro - I've opened #1950 which includes a fix for this (and an acceptance test now we've been able to isolate it) - thanks for the help here :) Thanks! |
I compiled the provider using the commit in #1950, but I still get the error on first destroy
|
Hi @tombuildsstuff & @JunyiYi We are now getting this error as well.
We had no luck removing the CustomScriptExtension and applying the attach disk resource. We are currently on v1.15 for the provider. Is there any work around? |
@jamespatetz @rohrerb , thanks for reporting it. And it would be helpful to provide your HCL scripts here. |
You removed the CustomScriptExtension from the VM using the web portal, right? It has to be removed from the VM by hand, and then taken out of the terraform plan before running the attach disks. At least my experience has been consistent. |
@rohrerb @stonefury can confirm if upgrading to v1.16 of the Provider fixes this for you? Thanks! |
@tombuildsstuff using 1.16 is working for me, several times I tested and I did not get the error subsequently Thanks! |
I deployed a VM with 1 attached disk. I manually added an extension (just picked datadog agent at random). Updated terraform to add a second disk. Behavior is hangs on still destroying/creating. It's been running for 15 mins. |
Could you describe your test, @jamespatetz ? |
Hi @tombuildsstuff we were able to attach disks with 1.16. Thank you for helping get this resolve. |
I guess this ticket was in regards to multiple disk attachments. I never had that problem. My issue is strictly related to adding disks after an extension is added to a VM. Has anyone else tested this scenerio?
Result: just hangs forever. |
@rohrerb @jamespatetz great, thanks for confirming that 👍 @stonefury thanks for confirming - since this is a separate issue (which is related to, but different to this issue); would you mind opening a new issue specifically for that? Thanks! |
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! |
Community Note
Terraform Version
0.10.4
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Trying to create 2 VMS and 4 data disks on each and attach them.
All 4 disks should be attached successfully.
Actual Behavior
Both the VMs get 1st disk attached successfully and for other disks get the following error:
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: