Skip to main content
rightsizing · azure

VMs tagged stateless that still pay for a persistent managed OS disk

resource types
1
rule IDs covered
1
severity
low

What does ZopNight detect here?

ZopNight flags an Azure VM tagged `stateless=true` whose OS disk is a persistent managed disk rather than an ephemeral one. An ephemeral OS disk lives on the VM's local storage, so the saving is the monthly tier price of the current managed OS disk, and the rule needs at least $5 a month to report.

Signal and threshold

How ZopNight evaluates VMs tagged stateless that still pay for a persistent managed OS disk.
Field Value
Rule IDsRC-1309
Categoryrightsizing
Severitylow
Metricnone — pure configuration read
Thresholdstateless=true tag, OS disk not ephemeral, saving >= $5/month
SourceZopNight
Permissions usedMicrosoft.Compute/virtualMachines/read · Microsoft.Compute/disks/read

The OS disk a stateless VM does not need to keep

Every VM with a persistent OS disk pays for a managed disk at that disk’s tier price, whether the disk holds anything worth keeping or not. The ephemeral OS disks page describes the alternative for stateless workloads: the OS disk is created on the VM’s local storage (its cache, temp or NVMe disk) and is not saved to Azure Storage. Reimaging is fast and latency is close to a temporary disk.

For scale-out web tiers, build agents and container hosts that are rebuilt from an image anyway, a managed Premium OS disk is paying for durability the workload has already decided it does not want.

Finding stateless VMs on managed OS disks

Terminal window
az vm list \
--query "[?tags.stateless=='true'].{name:name, rg:resourceGroup, size:hardwareProfile.vmSize, osDiskType:storageProfile.osDisk.managedDisk.storageAccountType, ephemeral:storageProfile.osDisk.diffDiskSettings.option}" \
-o table

An empty ephemeral column means a persistent OS disk. Check the OS disk size against the VM size’s local storage before planning a change.

Signals that must all be present

  1. Azure reports the VM’s OS disk setting, and it is not ephemeral. If the setting is unknown, the VM is not judged.
  2. The VM carries the tag stateless=true. There is no Azure property that says a workload keeps no state, so this relies on your own tag.
  3. The OS disk’s size and storage type are known, and a flat monthly tier price exists for them: Premium SSD, Standard SSD or Standard HDD.
  4. The resulting saving is at least $5 a month.

Why some VMs are skipped

VMs without the tag are never assumed stateless. OS disks priced by provisioned IOPS and throughput rather than by a flat tier, such as Ultra Disk and Premium SSD v2, cannot be priced this way and are skipped. When any input is missing, ZopNight raises no finding rather than report a zero or guessed saving.

Pricing the managed OS disk line item

Terminal window
monthly saving = OS disk tier hourly rate x 730
cost after change = 0 for the OS disk

This is the separate managed disk charge, not a share of the VM’s compute price. The figure assumes the ephemeral disk keeps the default Standard HDD base disk. Microsoft notes that if you choose a Standard SSD or Premium SSD base disk instead, you pay that base disk’s charges, which can shrink the saving to little or nothing.

Rebuilding the VM with an ephemeral OS disk

  1. Confirm nothing the workload needs is written to the OS disk.
  2. Record the VM’s size, network interfaces, data disks and extensions.
  3. Recreate it with an ephemeral OS disk, for example az vm create --resource-group my-rg --name my-vm --image <image> --size <size> --ephemeral-os-disk true.
  4. Reattach data disks, reapply extensions, and check the workload.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

472 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

472 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·