VMs tagged stateless that still pay for a persistent managed OS disk
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
| Field | Value |
|---|---|
| Rule IDs | RC-1309 |
| Category | rightsizing |
| Severity | low |
| Metric | none — pure configuration read |
| Threshold | stateless=true tag, OS disk not ephemeral, saving >= $5/month |
| Source | ZopNight |
| Permissions used | Microsoft.Compute/virtualMachines/read · Microsoft.Compute/disks/read |
Where it applies
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
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 tableAn 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
- Azure reports the VM’s OS disk setting, and it is not ephemeral. If the setting is unknown, the VM is not judged.
- 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. - 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.
- 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
monthly saving = OS disk tier hourly rate x 730cost after change = 0 for the OS diskThis 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
- Confirm nothing the workload needs is written to the OS disk.
- Record the VM’s size, network interfaces, data disks and extensions.
- 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. - Reattach data disks, reapply extensions, and check the workload.