You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Currently, storage_data_disk is not an attribute that azurerm_linux_virtual_machine or azurerm_windows_virtual_machine supports and we are forced to use a secondary azurerm_managed_disk and azurerm_virtual_machine_data_disk_attachment. While on the surface, this doesn't seem like a big deal, in some cases this can cause problems.
Issues with not being able to use a storage_data_disk in an azurerm_linux_virtual_machine specifically:
If using a cloud-init/user_data/custom_data script that mounts a disk to a specific location, it's very likely that the disk won't actually be created or attached when the script runs in the VM. Therefore the script fails.
In line with above, if we are creating a VM from a custom image that requires either a snapshotted data disk to exist to be mounted at a specific location, that's not possible either at the moment (or it will cause a bunch of errors in the VM when it boots up, presuming the disk mounts to the right spot in the end).
As it stands, if we want to leverage that kind of functionality, we have to revert to using the (soon to be deprecated) azurerm_virtual_machine resource.
Taking a look through this appears to be a duplicate of #6117 - rather than having multiple issues open tracking the same thing I'm going to close this issue in favour of that one; would you mind subscribing to #6117 for updates?
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Description
Currently,
storage_data_disk
is not an attribute thatazurerm_linux_virtual_machine
orazurerm_windows_virtual_machine
supports and we are forced to use a secondaryazurerm_managed_disk
andazurerm_virtual_machine_data_disk_attachment
. While on the surface, this doesn't seem like a big deal, in some cases this can cause problems.Issues with not being able to use a
storage_data_disk
in anazurerm_linux_virtual_machine
specifically:cloud-init
/user_data
/custom_data
script that mounts a disk to a specific location, it's very likely that the disk won't actually be created or attached when the script runs in the VM. Therefore the script fails.As it stands, if we want to leverage that kind of functionality, we have to revert to using the (soon to be deprecated)
azurerm_virtual_machine
resource.New or Affected Resource(s)/Data Source(s)
azurerm_linux_virtual_machine
,azurerm_windows_virtual_machine
Potential Terraform Configuration
References
https://stackoverflow.com/questions/61085490/using-cloud-init-on-an-azure-vm-to-mount-a-data-disk-fails
The text was updated successfully, but these errors were encountered: