Need to resize VMSS disk in Azure. Linux VMSS

2.7k Views Asked by At

I have created a VMSS with Ubuntu OS image in Azure. At the moment, I have 3 machines running with disks size of 30GB size. How do I scale up to 64GB or 128GB disks in my Linux VMSS instances? I tried creating a VMSS with managed disk and unmanaged disks, had an option to add data disk but no option to increase the size of existing disk.

Help me understand how do I extend or increase the default size of the disk of my existing VMSS instances which are running in Azure?

Thanks in advance. Incase you need some more information, please let me know, ill be happy to provide any additional info.

3

There are 3 best solutions below

0
On

If you're like me and MS decided to bump the minimum OS disk size of your chosen AKS node pool (VMSS) VM size from 30GB to 50GB and get errors like:

The specified disk size 30 GB is smaller than the size of the corresponding disk in the VM image: 50 GB. This is not allowed.
Please choose equal or greater size or do not specify an explicit size.\" Target=\"osDisk.diskSizeGB\"

here's what I did:

  1. Create new temporary nodepool with config that passes ARM validation:
az aks nodepool add -n tempinfra012 -g rg-common-app-temp-region-01 --cluster-name aks-common-app-temp-region-01 --subscription org-app-dev-01 \
--enable-encryption-at-host \
--kubernetes-version=1.26.6 \
--labels application='app-infra' \
--max-pods=80 \
--mode=System \
--node-count=3 \
--node-osdisk-size=50 \
--node-osdisk-type=Ephemeral \
--node-taints='system-infra=true:PreferNoSchedule' \
--node-vm-size=Standard_D2as_v4 \
--os-sku=Ubuntu \
--os-type=Linux \
--tags application='app-infra' \
--vnet-subnet-id=/subscriptions/<Sub-id>/resourceGroups/<VNET-rg>/providers/Microsoft.Network/virtualNetworks/VNET/subnets/snet-app-aks-01 \
--zones 1 2 3
  1. drain your original nodepool nodes (repeat for each node in the pool)
    kubectl drain aks-tempinfra01-NNNNNNNN-vmss000000 --ignore-daemonsets
  2. When happy with workload moved into the new tempinfra012 nodepool, delete the original pool with faulty config az aks nodepool delete -n tempinfra01 -g rg-common-app-temp-region-01 --cluster-name aks-common-app-temp-region-01 --subscription org-app-dev-01
  3. Re-create the original node pool tempinfra01 with valid configuration (see section 1.).

If you happen to have separated AKS node and pod subnets, remember to include the pod subnet in the nodepool creation command:
--pod-subnet-id=/subscriptions/<sub-id>/resourceGroups/<VNET-rg>/providers/Microsoft.Network/virtualNetworks/<VNET>/subnets/snet-app-dev-aks-pods-01

1
On

1.stop the VM. enter image description here

2.Click the existing disk name. enter image description here

3.Click configuration to resize the disk. enter image description here

1
On

Got a response from MSDN forum.

The way to resize the disk in linux VMSS is using the command.

az vmss update -n -g --set virtualMachineProfile.storageProfile.osDisk.diskSizeGb=150

Try it in a test environment as there are some issues with disk size in the new vm's that will be created in the scaleset