Daniel's Tech Blog

Cloud Computing, Cloud Native & Kubernetes

Identify the max capacity of ephemeral OS disks for Azure VM sizes

Back in 2019 Microsoft introduced the ephemeral OS disk option for Azure VMs and VMSS.

-> https://azure.microsoft.com/en-us/updates/azure-ephemeral-os-disk-now-generally-available/

Instead of storing and persisting the OS disk to the Azure remote storage the ephemeral OS disk is stored onto the VM’s cache. Hence, ephemeral OS disks are perfect for stateless workloads like Azure Kubernetes Service node pools.

For instance, the ephemeral OS disks are the default for new AKS node pools. And here is the general issue. When you specify an OS disk size which is larger than the VM’s cache size AKS falls back to the managed OS disk option. This happens especially with smaller Azure VM sizes compared to the larger ones.

I have written a PowerShell-based Azure Function and a PowerShell script tackling this problem and getting the max capacity of ephemeral OS disks for Azure VMs in an Azure region.

You call the Azure Function API endpoint under the following URL.

-> https://ephemeraldisk.danielstechblog.de/api/ephemeraldisk

As input parameters you provide the Azure region ?location=northeurope and you can provide the VM family &family=Dsv3 as a filter for the result set.

API call with northeurope as region API call with northeurope as region and Dsv3 as family filter

-> https://ephemeraldisk.danielstechblog.de/api/ephemeraldisk?location=northeurope
-> https://ephemeraldisk.danielstechblog.de/api/ephemeraldisk?location=northeurope&family=Dsv3

The difference between the function and the PowerShell script is minimal. Using the script, you only get the results for Azure VM sizes which are unlocked for the subscription. Where the function returns all VM sizes for an Azure region.

> ./Get-EphemeralOsDiskVmSizes.ps1 northeurope Dsv3
[
  {
    "Name": "Standard_D16s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 400,
    "EphemeralOsDiskSupported": true
  },
  {
    "Name": "Standard_D2s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 50,
    "EphemeralOsDiskSupported": true
  },
  {
    "Name": "Standard_D32s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 800,
    "EphemeralOsDiskSupported": true
  },
  {
    "Name": "Standard_D48s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 1200,
    "EphemeralOsDiskSupported": true
  },
  {
    "Name": "Standard_D4s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 100,
    "EphemeralOsDiskSupported": true
  },
  {
    "Name": "Standard_D64s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 1600,
    "EphemeralOsDiskSupported": true
  },
  {
    "Name": "Standard_D8s_v3",
    "Family": "DSv3",
    "MaxEphemeralOsDiskSizeGb": 200,
    "EphemeralOsDiskSupported": true
  }
]

Both solutions are available on my GitHub repository.


Posted

in

WordPress Cookie Notice by Real Cookie Banner