Azure Stateless VM Could Use Ephemeral OS Disk
What does ZopNight detect here?
VMs tagged stateless=true that still boot from a billed persistent OS disk are recommended to switch to a free ephemeral OS disk. Savings equal the managed-disk tier rate times 730 hours for the disk's size and SKU, subject to a $5 monthly floor; missing disk metadata or rates abstain.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-1309 |
| Category | rightsizing |
| Severity | low |
| Metric | none — pure configuration read |
| Source | vm_ephemeral_os.go |
Where it applies
Why the stateless tag has to be set by hand
Fires only when Metadata ephemeral_os_disk is present-and-not-”true” (discoverer-authoritative osDisk.diffDiskSettings.option; fail-closed when absent) AND the customer tag stateless=true (workload intent, no cloud equivalent) AND the OS-disk cost producer is present (os_disk_size_gb + os_disk_sku Metadata + a resolvable managed-disk tier rate). Abstains (returns nil) on any missing input, and never emits SavingsUSD=0 under this cost-driven category.
The OS disk line item ephemeral removes
concrete-or-abstain. The lever switches a persistent managed OS disk to a free ephemeral OS disk; the real saving = the managed OS-disk line item it removes = the flat monthly Managed Disks tier price for the OS disk’s size + storageAccountType (tierRate × 730), where tierRate is the pricing_cache row keyed Premium_SSD_Managed_Disk_P{n} / Standard_SSD_Managed_Disk_E{n} / Standard_HDD_Managed_Disk_S{n} (same flat-monthly-tier basis as RC-240/RC-1386). This is the separate OS-disk charge and not a fraction of VM compute: CurrentCostUSD = SavingsUSD = tierRate×730, OptimizedCostUSD = 0. Producer (wired): (1) discoverer enrichAzureVM stamps os_disk_size_gb (osDisk.diskSizeGB) + os_disk_sku (osDisk.managedDisk.storageAccountType) from the same ARG projection (no extra SDK call); (2) the Managed Disks tier rate is already ingested by the aggregator pricing (Premium/Standard SSD/Standard HDD Managed Disks meters → azureDiskTierKeyFromMeter) and reaches the rule via the existing SKURatesAware/TargetSKUCandidatesAware bulk-fetch, with no new setter or pricing change. IOPS-priced families (UltraSSD/PremiumV2) have no flat tier rate → abstain. $5/month minimum-savings floor. Note: the stateless axis remains tag-gated (no authoritative cloud/API signal exists to de-tag it). the quoted saving assumes the ephemeral OS disk keeps Azure’s default free Standard HDD base disk. Azure also lets a customer opt into a Premium/Standard SSD base disk to preserve read performance/SLA, and that base disk is itself a billed managed disk, so if that non-default option is chosen the realized saving is only partial (possibly ~$0). The Description and Remediation now call this out explicitly; SavingsUSD is not discounted for SSD-tier source disks, since the full saving is genuinely correct in the default/common configuration this rec targets.
Rebuilding the VM with a local OS disk
- Confirm the workload is truly stateless (no data persisted to the OS disk)
- Capture the VM configuration (size, NICs, data disks, extensions)
- Recreate the VM with storageProfile.osDisk.diffDiskSettings.option=Local at the same size
- Keep the ephemeral OS disk’s base disk on the default free Standard HDD to realize the full quoted saving; only pick a Premium/Standard SSD base disk if the workload needs the extra read performance/SLA, and expect the saving to shrink (possibly to ~$0) in that case
- Reattach data disks and re-apply extensions; validate boot and workload health