-
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
Update resource azurerm_virtual_machine with storage datadisk #1593
Comments
This issue was resolved? Or, the status of issue is still "opened"? |
In case this helps, I had an identical "Managed disk storage account type change" Azure error on terraform 0.12.10 but with no indication in the plan that the managed_disk_type was going to be changed (and, as far as I can tell afterwards - it wasn't : Premium_LRS = Premium SSD?) The VM in question was just imported into terraform, so some state information might have been missing (?). On the other hand, the error came from Azure, so terraform was trying to change something Azure did not allow us to change.
Plan (stripped of some lines not changing):
Again, no disks to be changed:
In the end, I stopped and deallocated the VM and then the terraform apply job went through without any errors, and without any discernable change in OS disk... |
Closing this as we're currently working on version 2.0 of the Azure Provider which we previously announced in #2807. azurerm_linux_virtual_machine We recently opened #5550 which adds support for the new Virtual Machine resources - which require attaching Data Disks using the azurerm_managed_disk and azurerm_virtual_machine_data_disk_attachment resources rather than having them defined inline, which allows for more granular control/flexibility when modifying disks. Since the existing Virtual Machine resource is being superseded, unfortunately we have no plans to backport this to the existing azurerm_virtual_machine resource - however we’ll be publishing information on the new resources (and how you can opt-into the Beta) in the near-future. Thanks
|
This has been released in version 2.0.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.0.0"
}
# ... other configuration ... |
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
Description
I purpose to update resource azurerm_virtual_machine with storage datadisk. Today if you deploy a VM with a Premium datadisk, and you want change this value to "Standard" after deployment, Terraform can't do this change.
But if you use resource azurerm_managed_datadisk, to create your datadisk, this resource is able to change "Premium" > "Standard" or "Standard" to "Premium" datadisk if your VM is offline.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: