Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
14.07k stars 16.13k forks source link

Initialize and format disks in 101-vm-multiple-data-disk #3396

Open letmaik opened 7 years ago

letmaik commented 7 years ago

101-vm-multiple-data-disk

Issue Details

I find this template a bit incomplete as the created disks are not initialized and formatted. Isn't the point of these automated deployments to do everything in there and not having to RDP to the VM and finish up?

Can the template be expanded so that the disks are initialized and one partition per disk is created with a given drive letter? That would help immensely.

letmaik commented 7 years ago

So, there should be a CustomScript which runs something like:

powershell -Command Get-Disk | Where-Object partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -Confirm:$false

(reference: http://naeem.khedarun.co.uk/blog/2015/12/03/attaching-and-formatting-drives-with-azure-arm-and-powershell/)

tomer314 commented 5 years ago

Any update on this? Is there any way to initialize the new disks automatically?

DanteNahuel commented 4 years ago

Any update or workaround to this? When you create the VM from Azure it initializes the Disks automatically so there must be a way of doing it...