Azure Linux VM & Windows VM Disk Resize limitations

Something I notice in Azure Linux VM and Windows VM after a TIER PLAN UPGRADE

  • When you purchase a Plan, example you get A0 Plan (1 Cores | 0.75gb RAM | 20GB disk)
  • You ran out of initial OS drive space which is 20gb.
  • Logged into Azure to upgrade plan to A2 (2 Cores | 3.5gb RAM | 135GB disk)
  • Verified new upgraded plan but noticed that the OS disk is still full and still showing 20gb full.
  • YOU ARE COMPLETELY STUCK –Microsoft has a limitation as there is no way to increase drive or resize drive size. – (SHAME ON MICROSOFT) as this is a big NO to enterprise environment.
  • Base on Microsoft Azure support TechNet site, a Microsoft engineer mentioned a work around which I will not recommend any infrastructure to do this steps below:
    • Shutdown the VM
    • Delete the VM -or- detach the disk if it’s not the OS disk
    • In the Windows Azure portal, delete the disk (retain the data!) do that the lease Windows Azure has on it is removed
    • Run WindowsAzureDiskResizer
    • In the Windows Azure portal, recreate the disk based on the existing blob
    • Recreate the VM -or- reattach the disk if it’s not the OS disk
    • Start the VM
    • Use diskpart / disk management to resize the partition

Welcome to John’s Recommendation : see below:

If you going via AD

  1. First you have to install Azure PowerShell on windows machine
  2. Open “Microsoft Azure PowerShell” console in an elevated state.
  3. Type the following command: Get-AzurePublishSettingsFile.
  4. This will prompt you to enter login details for your Azure subscription account.

If you going via Certificate method

  1. Sign in to account on the Azure Management Portal.
  2. Open the Azure PowerShell console in an elevated state.
  3. Type the following command: Get-AzurePublishSettingsFile
  4. If you are logged into you azure account a download will launch in your web browser.

Confirm account and subscriptions available to PowerShell

Use the:

  1. Get-AzureSubscription
  2. Command to list all accounts and subscriptions available.

Now this is what you will have to do to FIX the OS disk size issue:

  • Power off the Virtual Machine
  • In Azure powershell, type Get-AzureDisk
  • Copy the DiskName from the output and place it in this command below:
  • Example: Update-AzureDisk –DiskName "[Disk name]" -Label "ResiZedOS" -ResizedSizeInGB [New Plan Disk Size in GB]
  • Original commande: Update-AzureDisk –DiskName " CP-0-201602242013070428" -Label "ResiZedOS" -ResizedSizeInGB 135
  • Power On Virtual Machine
  • Go into your linux or windows machine to extend the OS disk volume
  • YOU ARE GOOD TO DO :)