How to Resize Azure VM OS Disk

Problem:

Sadly, I cannot find a way to resize a VM OS Disk using Azure Dashboard.

Solution:

  1. Stop / deallocate the VM using Azure Dashboard.
  2. Launch Windows Powershell and run the following command
  3. “Add-AzureAccount”.  Enter your login and password.
  4. “Select-AzureSubscription –SubscriptionId <subscriptionId>”.  You can use Azure Dashboard to view the SubscriptionId.
  5. Get-AzureVM -ServiceName “<Cloud Service Name>” -Name “<VM Name>” | Get-AzureOSDisk
  6. Update-AzureDisk -DiskName “VMOSDisk” -Label Resized -ResizedSizeInGB 60
  7. “Remove-AzureSubscription – SubscriptionId <subscriptionId>”
  8. Start the VM.
  9. Use VM’s Disk Management and Expand the Disk so it will use any new disk usage.

Reference:

https://blogs.msdn.microsoft.com/madan/2015/11/02/resizing-azure-vm-os-or-data-disk/

http://www.intstrings.com/ramivemula/articles/jumpstart-38-connect-to-azure-subscription-from-powershell/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s