Azure-quickstart-templates: Initialize and format disks in 101-vm-multiple-data-disk

Created on 27 Apr 2017  路  3Comments  路  Source: Azure/azure-quickstart-templates

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.

Most helpful comment

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/)

All 3 comments

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/)

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

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...

Was this page helpful?
0 / 5 - 0 ratings