Have you ever noticed that your Azure VM has a 30GB OS disk.  Azure defaults the OS disk to 30GB, but if you look at the Managed Disk Pricing, the minimum size you are charged for is 32GB.

So how do you create an VM with the extra 2GB – not through the Portal.  Instead, try the Azure CLI to create your VM.

You need to specify the following option during VM creation:

--os-disk-size-gb 32

Here is a sample setup:

az vm create 
  --name {Server Name} \
  --resource-group {Resource Group Name} \
  --subscription {Subscription ID} \
  --image UbuntuLTS \
  --os-disk-size-gb 32 \
  --storage-sku Premium_LRS \
  --size Standard_D2s_v3 \
  --location eastus2 \
  --authentication-type ssh \
  --admin-username {User Name} \
  --ssh-key-values {SSH KEY or your SSH ~/.ssh/id_rsa.pub }

For additional VM creation options, try:

az vm create --help

Alternatively, if your VM is already running, you

  • Backup the disk (things can go bad quickly when changing partitions; it's good to have a backup)
  • Stop the VM
  • Resize the OS DISK through the Azure Portal or CLI
  • Restart the VM
  • Resize the OS Disk partition in your OS (instructions vary by OS)

Give it a shot and let me know what you think.