-
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
Resource azurerm_virtual_machine -> storage_os_disk creates disk resource that can't be modified (tags) #2568
Comments
This is also an issue for me. Any recommendations? |
The bug has been labled with "question". I'm not sure what the question is, imho the bug has been described very well and just avoided that we open a new one... |
I am not sure why it was ever tagged as a question. It was more of explaining the unexpected behaviour with the tagging on disks created by the azurerm_virtual_machine. I thought that there was a question internally that needed answering. Hopefully, that clarifies what I originally put down! (Although feel free to ping me any questions on this!) |
It was a question to the developer, I'm not an developer myself. |
I took a look myself: The initial tag is done by the azure api. The azure process to create an instance writes the tags to the boot vhd. So this has not been done by terraform intentionally. A clean workaround would be to have the boot VHD in terraform as independent managed ressource.
With this workflow the boot VHD is managed by terraform and you can change the tags. We do not want to rely on latest images. We define a version, and if we bump the version, we test the new image beforehand. |
This isn't possible on azurerm_linux_virtual_machine. There is no option to attach to an OS disk. |
#6117 is more about attaching data disks to the vm pre-boot via a data_disk block. |
hi @mystcb Taking a look through here the As such I'm going to close this issue for the moment - but I'd recommend looking into the 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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
When updating the tags on an
azurerm_virtual_machine
resource, it should update the tags on the managed disk created by thestorage_os_disk
block.Actual Behavior
The managed disk created by Terraform during the creation of the
azurerm_virtual_machine
resource doesn't get updated with changes to the tags.Steps to Reproduce
azurerm_virtual_machine
resource.storage_os_disk
block to generate the OS BOOT drive.azurerm_virtual_machine
resource levelterraform apply
to depoy the VM and Boot Disk - wait for creationazurerm_virtual_machine
resource tags to modify one of the existing values.terraform plan
shows tags being updated at theazurerm_virtual_machine
resource level. But not the managed diskterraform apply
updates theazurerm_virtual_machine
resource, but doesn't touch the managed disk.The text was updated successfully, but these errors were encountered: