Open BuriedStPatrick opened 2 years ago
This was not supposed to be posted until I was absolutely sure and had a potential configuration. I can't delete it, so I will update with potential config later.
Enter-button got me in the New or Affected Resource(s)/Data Source(s)
field and submitted instead of adding a line, sorry.
Edit: I updated the issue with some configuration examples. I also have not been able to find any other issues regarding this problem apart from someone else having a similar issue not getting any help on the Terraform forums.
Any update on this?
Any update?
Has there been any progress on implementing this enhancement?
This looks like it was added in https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v3.21.0
@samcarswell if you're saying about the block data_disk , it allows you to create a new drive, but not to attach an existing one. Looking forward this update
I was about to create a cluster with shared disk and hit my head with this. data_disk only seems to be capable of creating local disk, while in Azure it is also possible to attach separate disk as shared to all nodes.
But I guess this also requires change to azurerm_managed_disk since there needs to MaxShares setting: https://learn.microsoft.com/en-us/azure/virtual-machines/disks-shared-enable?tabs=azure-resource-manager
Is there an existing issue for this?
Community Note
Description
Currently it's possible to add a managed disk attachment to individual VMs using
azurerm_virtual_machine_data_disk_attachment
. But there doesn't seem to be any support for this when it comes to Virtual Machine Scalesets.This is already possible in Azure.
New or Affected Resource(s)/Data Source(s)
azurerm_linux_virtual_machine_scale_set
azurerm_windows_virtual_machine_scale_set
azurerm_virtual_machine_data_disk_attachment
Potential Terraform Configuration
I have two suggestions on the configuration with some variation.
Suggestion 1: As part of the VMSS definition
Variation A
Add an
attached_data_disk
property mirroringdata_disk
. Difference being it would be shared between all VM instances.Variation B
Instead of a new property
attached_data_disk
, simply switch on a new propertydata_disk.type
.Suggestion 2: As a separate attachment resource
This is similar to how it's done for
azurerm_virtual_machine
withazurerm_virtual_machine_disk_attachment
.References