r/(linux|windows)_virtual_machine - support for managed_disk_id
from an existing OS disk #8195
Open
Description
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
Description
We want to build an instance from a pre-defined managed disk. You forgot to adopt this feature from azurerm_virtual_machine in the new azurerm_*_virtual_machine.
In the legacy resource you could do the following:
storage_os_disk {
name = "myosdisk1"
caching = "ReadWrite"
create_option = "Attach"
managed_disk_id = "..."
managed_disk_type = "Standard_LRS"
}
New or Affected Resource(s)
- azurerm_linux_virtual_machine
- azurerm_windows_virtual_machine
Potential Terraform Configuration
os_disk {
caching = "ReadWrite"
managed_disk_id = "..."
storage_account_type = "Standard_LRS"
}
References
Use case is to manage metadata of the OS disk. The details are described here:
EDIT:
After comment from @tombuildsstuff I removed create_option = "Attach"
from the "Potential Terraform Configuration" hcl, since "it should be managed by Terraform due to the quirks behind it"