Q. How can I resize a disk in Azure?
A. Because Azure Storage uses sparse storage which means you only pay for data actually written instead of the actual size of the VHD the best practice is to normally create disks as the maximum 1023 GB (the exception is Azure Premium Storage which charges you based on the size of the disk and NOT the amount of data written). If you have disks you want to resize you can use a REST API which I walked through in FAQ http://windowsitpro.com/azure/communicate-azure-rest-powershell or use the Update-AzureDisk cmdlet. The most common use I see of the resize is for OS disks which are 127 GB by default and a bigger size is required however typically data disks should be used rather than placing data on the OS disk. Note to change a disk the VM connected to it must be powered off and deallocated.
The usage is very simple:
To view all the disks with the attached VM, label and actual disk name (which is what you need) run:
Get-AzureDisk | ft Label, AttachedTo, DiskName -AutoSize
Once you have the actual diskname perform the resize:
Update-AzureDisk -DiskName <diskname> –ResizedSizeInGB 200 –label TinyVMOS
Remember that the new disk size must be between 20 GB and 1023 GB. Below is an example resize. Once the disk is resized you can then expand or add new volumes inside the guest OS.
PS C:\> Update-AzureDisk -DiskName TinyVM-TinyVM-0-201507181508090740 -ResizedSizeInGB 200 -Label TinyVMOS OperationDescription OperationId OperationStatus -------------------- ----------- --------------- Update-AzureDisk a6fa5c9e-2c66-05c3-b0c2-292694e12aef Succeeded