1
votes

I have provisioned an Azure Kubernetes Cluster which uses Virtual machine scale sets containing 3 virtual machines. The issue is that there is storage automatically attached to each VM, namely P10 Premium SSD type. To be honest I would like to have smaller disks and P4 Premium SSD disk would be totally enough for my business use case. For possible Azure disks, I could find more info at this link.

What is the easiest way to replace the premium storage disks?

First option would be to change the existing storage size of the VMs. As far as I read it from here at part "Properties with restrictions on modification", it is not possible. My next option was to create a new virtual machine scale set. During creating (using azure portal UI) I had no any option where I could specify the specific disk type. I could only choose from "StandardHDD", "Standard SSD", "Premium SSD". It seems for me that the P10 is the default premium storage.

Last but not least, I have found a Microsoft tutorial which describes how to attach and detach additional disks to a scale set. This looked promising but most of the specified commands are outdated (2 years old) cant be used with azure-cli 2.2.

So my question again: What is the easiest way to replace or reduce the premium storage disks of virtual machines within Azure Virtual Machine Scale Sets? Thanks in advance!

2

2 Answers

2
votes

The size of the OS disk depends completely on the base image of the VM. You can increase it, but you can't go lower. I answered a similar question the other day. P10 prizing means 100GB.

Btw.: You can't easily replace the "default" scale set of an existing AKS Cluster.

At the time of this answer, this is the image which is used by the AKS Clusters:

Image reference

Publisher: microsoft-aks
Offer: aks
SKU: aks-ubuntu-1604-202003
Version: 2020.03.05

These base images always have a 100GB OS disk.


If you create a scale set with the default Ubuntu image, you will get a scale set with 30GB Premium disks:

Image reference

Publisher: Canonical
Offer: UbuntuServer
SKU: 18.04-LTS
Version: latest

I have no idea how you could convice AKS to use your scale set or base image instead of theirs. At least not in a way that Microsoft intended. There is a blog post which talks about replacing(updating) the base image. You could adapt to your smaller base image, but I have no idea if this will work.

1
votes

AzureCLI has an option to define OS disk size while creating new node pool --node-osdisk-size:

https://docs.microsoft.com/en-us/cli/azure/ext/aks-preview/aks/nodepool?view=azure-cli-latest#ext-aks-preview-az-aks-nodepool-add

so I assume, you could create a new node pool manually providing OS disk size and later delete the old one. Just be sure to have at least one system node pool or you won't be able do delete your first (default) pool!

https://docs.microsoft.com/en-us/azure/aks/use-system-pools

Unfortunately, for now there is no option to choose OS disk type while creating new node pool, so best possible for desired VM is automatically chosen. Also OS disk type is create-time property of VM Scale Set so you can't change it later.

https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-upgrade-scale-set#properties-with-restrictions-on-modification