+91 11 4576 8059
Open hours : Mon - Fri : 10:00 - 18:00

Expand the OS drive of a Virtual Machine (ARM)


When you create a virtual machine (VM) in a Resource Group from Azure Marketplace, the default OS drive is 127 GB. Despite the fact that it’s recommended to add data disks to the VM  for applications and CPU intensive workloads installation, in many cases customers need to extend the OS drive to support certain situations, for example:

Support old/legacy applications.

Lift and Shift scenarios (On Prem to Cloud)

Steps to resize the disk

  1. Sign-into your Microsoft Azure account using Power Shell:
Login – AzureRmAccountSelect – AzureRmSubscription – SubscriptionName ‘my-subscription-name’
  1. Select your Resource group name and VM name:
$rgName = ‘my-resource-group-name’$vmName = ‘my-vm-name’
  1. Get a reference to your Virtual Machine:
$vm = Get-AzureRmVM -ResourceGroupName $rgName -Name $vmName
  1. Stop the Virtual Machine.
Stop-AzureRmVM -ResourceGroupName $rgName -Name $vmName
  1. Set the OS disk size to desired value, greater than the current size and less than 1023 (maximum)
$vm.StorageProfile.OSDisk.DiskSizeGB = 1023Update-AzureRmVM -ResourceGroupName $rgName -VM $vm
  1. Start the team VM after above command is completed
Start-AzureRmVM -ResourceGroupName $rgName -Name $vmName

And that’s done! Now RDP into the Virtual Machine, Open Disk Management and expand the drive using the new space.

Leave a Reply