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
Create multiple VMs with managed azure disks #1331
Comments
Thanks for opening this issue :) Taking a look at the configuration you've posted above, I notice two things:
The name you're using for the OS Disk appears to be different to the one used for the VM - as such I'm wondering if this disk already exists, as I believe this would lead to the error message that you're seeing above. Would you be able to take a look and confirm this for me? :) Thanks! |
Hi, @tombuildsstuff ! Happy to see you here :) If i understand you properly - both parameters you specified should be the same. So I've changed my config file to look as follow:
However, it lead me to the same error as before:
I've partially modified the output for security (cleared |
@ArseniiPetrovich no problem, thanks for getting back to us here :)
Kind of, I'm trying to confirm that both the Virtual Machine and the OS Disk (Managed Disk) don't already exist; as that would explain the error being returned from the Azure API here. Would you be able to confirm that both the VM and the OS Disks don't exist prior to provisioning the VM with Terraform (e.g. in the Portal)? Taking a quick look at the configuration above - this looks fine; which is why I believe one (or both) of these already exists (but I may be wrong 😄). Thanks! |
I finally got it! |
This is actually a bug in the Azure Provider where it works differently to the other Providers (e.g. AWS/Google) where the other Providers will complain that a resource already exists, and requires that you import the existing resource in order to be able to modify it (whereas the Azure Provider just upserts them currently due to the nature of the Azure API's [which are all Upserts]). It's something we're aware of and will be fixing in the near future (we're trying to decide how's best to roll this out, if that's in one go or gradually)
Not at all - I'm glad to hear this is now working for you :) |
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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform Version
v0.11.7
azurerm 1.6.0
Affected Resource(s)
azurerm_virtual_machine.storage_os_disk
Terraform Configuration Files
Debug Output
Will be happy to provide if needed.
Expected Behavior
Azurerm creates each node with its own disk.
Actual Behavior
Azurerm creates one disk, and then trying to assign it to each node (it also tries to rename the existing disk, so i get the following errors):
Steps to Reproduce
terraform
terraform plan
terraform apply
References
The text was updated successfully, but these errors were encountered: