Business Challenge
#113 ended on the temp disk and the host cache as performance details. This post is about what happens when you put the operating system on them.
The default arrangement is that an Azure VM's OS disk is a managed disk in Azure Storage: durable, replicated, snapshot-able, backed up, and reachable over the network. Every one of those properties is a cost. The durability is paid for in money, the replication in write latency, and the network reachability in a dependency — your VM's root filesystem lives in a different service, and if that service has a bad day in your region, your VM does too.
For a stateless instance none of that is a good trade. A scale set member that holds no state and is replaced rather than repaired does not need a durable OS disk; it needs to boot fast, read fast and be cheap to throw away. Ephemeral OS disks are the option that says so out loud: “Ephemeral OS disks are created on the local virtual machine (VM) storage and not saved to the remote Azure Storage.”
What the documentation says it is for
“Ephemeral OS disks are ideal for stateless workloads, where applications can tolerate individual VM failures but are sensitive to VM deployment times or the reimaging of individual VM instances.”
Read that as two separate qualifications, because they are. “Can tolerate individual VM failures” is an architecture property you have to already have. “Sensitive to deployment times” is the reason to bother. Having only the second is how this feature gets chosen wrongly.
Architecture
Where the OS disk actually is
There are two modes, and the distinction is more consequential than the name “caching” suggests.
| Partial caching (default) | Full caching | |
|---|---|---|
| Layout | “Splits the OS disk between a diff disk on local storage and a base disk in managed disks” | “Caches the entire OS disk on local storage” |
| Writes | All on the local diff disk | All local |
| Reads of original files | Served by the remote base disk | Local once cached |
| Remote dependency | Still present for reads | “Completely removing dependency on remote storage in steady state” |
| Local space cost | One OS disk | 2× the OS disk |
| Availability | All regions, all supported sizes | All public regions, 8 or more vCPUs |
Partial caching is what everyone already has: “All existing ephemeral VMs are created in partial caching mode.” So if you adopted ephemeral OS disks any time before this feature shipped, your VMs still read original image files over the network.
Full caching is the one worth a design conversation, and its justification in the documentation is not speed. It is “greatly improves the resilience of general-purpose VMs and virtual machine scale sets during remote storage outages” — outages “often caused by extreme weather or power failures” that “can lead to VM downtime events.” That is a reliability feature wearing a performance feature's name, and it is the strongest argument in this whole post: a fleet of stateless VMs with fully cached OS disks has removed a shared regional dependency from its blast radius.
The prerequisites are precise: “Local disk size must be greater than (2 Γ OS disk size + 1 GiB)”, API version 2025-04-01 or later, a stateless OS disk, and a VM with eight or more vCPUs from a named list — all N, L, M and H series, v5/v6/v7 D, DC, E, Eb and EC series, and v6/v7 F series. Support for two- and four-vCPU VMs is “planned for a future release.” And the caching happens “in the background after the VM boots up”, which “ensures no impact on VM creation times” — so there is a window after boot where you have the cost and not yet the benefit.
Three placements, and the question is what is left over
Local storage comes in three shapes depending on the VM generation, so “the placement option defines where the Ephemeral OS Disk is stored.” Crucially, “Placement option however doesn't impact the performance or cost of Ephemeral OS disk. Its performance is dependent upon the VM's local storage.” The decision is therefore not about speed. It is about what you have left for everything else.
| Placement | Sizes | What it consumes | What remains |
|---|---|---|---|
NvmeDisk |
GA on v6 and later β Dadsv6, Ddsv6, Dpdsv6 | “Utilizes the entire NVMe disk” | Nothing, on a single-disk size β “no NVMe disk space given back” |
ResourceDisk |
VMs with a temp disk β Dadsv5, Ddsv5 | Space equal to the OS disk size | Initial temp size − OS image size, sharing the temp disk's IOPS |
CacheDisk |
Older sizes with a cache β Dsv2, Dsv3 | Space equal to the OS disk size | Cache size − OS image size |
The NVMe row is the one that surprises people, and the worked comparison in the FAQ is the clearest statement of it. A standard Ubuntu image on a Standard_D2ads_v5 with temp disk placement gives “an OS disk size of 30 GiB & temp disk size of 45 GiB”. The same image on a Standard_D2ads_v6 with NVMe placement gives “an OS disk size of 30 GiB with no NVMe disk”. Same image, same intent, and one of the two loses all of its local scratch space.
Microsoft's own advice is to “maximize the OS disk Size property to 110 GiB” on a Standard_D2ads_v6 — since the whole 110-GiB NVMe disk is consumed regardless, you may as well have the space inside the OS disk rather than stranded. That is a genuinely useful trick and a strange one: the right OS disk size is not the one your image needs, it is the one your local disk has.
Multi-disk NVMe sizes behave better. “NVMe Disk Placement utilizes the minimum number of disks required for the OS disk” — on a Standard_D16ads_v6 with two 440-GiB disks, an OS disk under 440 GiB uses one and “The second NVMe disk is returned to you as a raw local disk.”
Placement is a creation-time, irreversible decision
“Once the ephemeral OS disk is provisioned, the OS disk placement can't be changed.” The only route is to recreate the VM, which “results in the recreation of the VM with Data on the OS disk deleted and OS is reprovisioned.”
Azure picks a default placement from the VM SKU if you do not specify one, so a template that omits DiffDiskPlacement has made this decision implicitly — and will make a different one when somebody changes the VM size.
Why This Architecture Holds Up
Because the list of things you give up is longer than the list of things you gain
The benefits fit in a sentence: lower read/write latency, faster reimage, no OS disk storage charge, and optionally no remote dependency. The costs need a table, and every row of it is a capability some other part of your organisation may be assuming.
| Operation | Persistent OS disk | Ephemeral OS disk |
|---|---|---|
| Stop-deallocate and restart | Supported | Not Supported |
| Stop/start of VM | OS disk data preserved | Not Supported |
| Resize to a new VM size | OS disk data preserved | Data deleted, OS reprovisioned |
| Redeploy | OS disk data preserved | Data deleted, OS reprovisioned |
| Maintenance via healing | OS disk data preserved | Not preserved |
| Maintenance via Live Migration | OS disk data preserved | Preserved |
| OS disk resize | At creation and when stop-deallocated | At creation only |
| Specialized OS disk | Yes | No |
| Unmanaged OS disk | Supported | Managed only |
| Size limit | 4 TiB | Local disk size, or 2,040 GiB, whichever is smaller |
Then a separate, blunter list: “VM Image Capture, Disk snapshots, Azure Disk Encryption, Azure Backup, Azure Site Recovery, OS Disk Swaps” — all unsupported.
Three of those deserve singling out because they usually belong to somebody else.
No stop-deallocate breaks the most common cost-control reflex there is. The FAQ is explicit about the replacement behaviour: “There's no option of Stop-Deallocate for Ephemeral VMs, rather users need to Delete instead of deallocating them.” So the nightly shutdown automation that saves money on a dev fleet does not apply, and anyone who tries it on an ephemeral VM is doing something the platform will refuse. Note the pleasant corollary from #112: since you must delete rather than deallocate, you also release the vCPU quota, which a stopped persistent VM does not.
No Azure Backup and no Site Recovery is a compliance statement, not a technical one. A policy that says “every VM is backed up” is unsatisfiable for these instances, and the honest version of the design is that the OS disk contains nothing worth recovering — which must be true, auditable, and written down, because an exemption that exists only in an engineer's head is the kind that gets discovered during a recovery.
Healing does not preserve the disk, and Live Migration does. Both are platform-initiated maintenance, and you do not choose which one Azure uses. So an ephemeral VM's OS disk can be reset by a maintenance event you did not schedule, at a time you did not pick. For a stateless instance that is a non-event. For anything that accumulated state on the OS disk since boot — a log, a lock file, a cached credential — it is silent data loss with no alert.
Because the Windows page file moves, and that changes your sizing
A small row in the comparison table with real consequences: with a persistent OS disk, “For Windows, page file is stored on the temp disk”. With an ephemeral OS disk, “For Windows, page file is stored on the OS disk (for cache placement, Temp disk placement & NVMe disk placement).”
So the OS disk now carries the page file as well as the operating system, on a disk whose maximum size is the local storage you have, on a VM where the local storage has already been reduced by the OS disk itself. Combine that with full caching's 2× requirement and the size arithmetic gets tight quickly. This is the kind of interaction that does not show up in a proof of concept with a 30-GiB Linux image and does show up on a Windows fleet.
Because the size arithmetic decides whether the feature exists for you
The rule is one sentence — “The image OS disk's size should be less than or equal to the NVMe/temp/cache size of the VM size chosen” — and the examples are where it bites.
| Case | Image | Requirement | Result |
|---|---|---|---|
| Windows Server, cache placement | ~127 GiB | Cache ≥ 127 GiB | Standard_DS3_v2 has exactly 127 GiB β “the smallest size in the DSv2 series that you can use” |
| Ubuntu, temp placement | ~30 GiB | Temp ≥ 30 GiB | Standard_B4ms has 32 GiB β leaving 2 GiB of temp disk |
| Ubuntu, NVMe placement | ~30 GiB | NVMe ≥ 30 GiB | Standard_D2ads_v6 has 110 GiB β all of it consumed |
| Image equals temp size | = temp | β | “Temp disk is not created” |
The second row is the sharp one. A B4ms with a 32-GiB temp disk and a 30-GiB Ubuntu image leaves two gigabytes of temp disk, and anything that assumed scratch space there now has none. The feature worked, the VM booted, and a downstream component ran out of disk.
Trusted Launch adds a fixed tax on top: “VMs using trusted launch by default reserve 1 GiB from the OS cache or temp disk or NVMe disk based on the chosen placement option for VMGS.” The documented failure is worth reading in full because the error message is not self-explanatory — a 75-GiB image on a Standard_D2ads_v5 with temp placement fails with “OS disk of Ephemeral VM with size greater than 74 GB is not allowed”, because the temp disk is 75 GiB and one gibibyte went to VMGS. The same deployment without Trusted Launch succeeds. Confidential VMs reserve the same 1 GiB for the same reason.
The Trusted Launch warning that is easy to skim
“If you use ephemeral disks with Trusted Launch VMs, any keys or secrets that the vTPM generates or seals after the VM is created might not be saved. As a result, these keys and secrets could be lost during actions such as reimaging or service healing events.”
Anything that seals a secret to the vTPM after provisioning — disk encryption keys, an attestation-bound credential, a measured-boot secret — is storing it somewhere that a maintenance event can erase. #115 covers Trusted Launch properly; this is the interaction to carry into it.
And the same irreversibility applies to key management. “Updating a CMK key version or key rotation isn't supported with Ephemeral OS disk. VMs using Ephemeral OS disks need to be deleted before updating or rotating the keys and can be re-created later.” Key rotation becomes fleet replacement. For a stateless fleet that is a rolling redeploy, which is fine — and it is another thing that must be true, not hoped.
Because the base disk is now a choice, and it is a different choice per mode
A detail that is easy to miss, because “ephemeral” implies there is no remote disk at all. Under partial caching there is: the base disk. It used to be fixed, and is not any more — “Previously, the base disk could only be Standard HDD. Now, customers can choose between the three types of disks: Standard HDD(Standard_LRS), Standard SSD (StandardSSD_LRS), or Premium SSD (Premium_LRS).”
Two reasons to care, both documented. “VMs created with Premium SSD provide higher SLA than VMs created with Standard HDD” — so the base disk type moves your VM's availability commitment, which is not where anyone looks for it. And on performance: “While most writes occur on the local temp disk, some reads are performed from managed disks. Premium SSD disks provide 8-10 times higher IOPS than Standard HDD.”
Which produces a neat interaction with the two modes. Under partial caching the base disk type matters because original-file reads go to it. Under full caching, in steady state, it stops mattering for reads — but you still “pay the applicable base disk charges with either partial or full caching.” So full caching plus a Premium SSD base disk is a combination where you are paying for read performance you have arranged not to need, except during the window after boot before the cache fills.
Because it is creation-time only, and all-or-nothing per scale set
Two FAQ answers close off the usual migration path. “Ephemeral OS disk can only be used during VM and scale set creation” — there is no conversion. And “you can't have a mix of ephemeral and persistent OS disk instances within the same scale set” — so there is no canary either.
That makes adoption a new scale set beside the old one, shifted over behind whatever is distributing traffic to it, which is a larger change than the feature's one-line template diff suggests. The template diff itself is genuinely small:
| Interface | What you set |
|---|---|
| ARM template | diffDiskSettings with "option": "Local" and "placement" of CacheDisk, ResourceDisk or NvmeDisk, plus "caching": "ReadOnly" |
| Full caching | "enableFullCaching": true inside diffDiskSettings, on API 2025-04-01 or later |
| Azure CLI | --ephemeral-os-disk true, --ephemeral-os-disk-placement, --os-disk-caching ReadOnly, and --ephemeral-os-disk-enable-full-caching true |
| PowerShell | Set-AzVMOSDisk -DiffDiskSetting Local -DiffDiskPlacement ResourceDisk -Caching ReadOnly, or Set-AzVmssStorageProfile for scale sets |
One operational note on diagnosing it. If the portal greys the option out, the documentation's explanation is the size arithmetic rather than a missing capability: “you might have selected a VM size that doesn't have a cache/temp size larger than the OS image or that doesn't support Premium storage.” And once running, “Ephemeral disks aren't accessible through the portal. You receive a 'Resource not Found' or '404' error when accessing the ephemeral disk, which is expected” — a 404 on the OS disk is the feature working, which is worth telling an on-call engineer before they find it at 3am.
Key Architecture Decisions
| Decision | Choose this | Because |
|---|---|---|
| Is this workload a candidate at all? | Only if it already tolerates losing an instance | Healing, redeploy and resize all reprovision the OS without warning |
| Removing a regional storage dependency | Full caching, 8+ vCPU size | It is the only mode that removes the remote read path in steady state |
| Inherited ephemeral VMs | Assume partial caching | Every ephemeral VM created before full caching is in partial mode |
| Local scratch space matters | Temp disk placement, not NVMe | NVMe placement consumes the entire disk on a single-disk size |
| Stuck with NVMe placement | Maximise the OS disk size to the NVMe size | The whole disk is consumed anyway β stranded space or usable space |
| Needing both OS and raw local disk on NVMe | A multi-disk size such as D16ads_v6 |
Only the minimum disks are used; the rest come back as raw local disks |
| Writing the template | Set placement explicitly |
Azure picks a default from the SKU, so a size change silently changes placement |
| Windows fleets | Budget the page file on the OS disk | It moves off the temp disk for every placement option |
| Trusted Launch or Confidential VMs | Subtract 1 GiB before sizing | VMGS reserves it, and a 75-GiB image on a 75-GiB temp disk fails |
| Secrets sealed to the vTPM | Do not rely on them persisting | They may be lost on reimage or service healing |
| Partial caching, read-sensitive image | Premium SSD base disk | Higher SLA, and 8-10 times the IOPS on reads that still go remote |
| Full caching, cost-sensitive | Standard base disk is defensible | Base disk charges apply either way, but steady-state reads are local |
| Adopting on an existing fleet | Build a new scale set and shift traffic | Creation-time only, and no mixing within one scale set |
| Cost-control shutdown schedules | Delete, do not deallocate | Stop-deallocate is unsupported β and deleting releases vCPU quota too |
| Backup and DR policy | Record a documented exemption | Azure Backup and Site Recovery are unsupported, not merely unused |
Closing Thought
Ephemeral OS disks are the clearest statement in Azure compute that durability is a cost rather than a virtue. Every property a managed OS disk gives you — replication, snapshots, backup, survivability across a stop — is paid for in latency, money and a dependency on another service. If the instance is genuinely disposable, all of it is waste, and the feature lets you stop buying it.
The trap is that “genuinely disposable” is an architectural claim about everything else, and this feature is a single checkbox. Nothing in the deployment validates that your instance is stateless; the platform simply stops preserving the OS disk and waits to see whether that was true. The feedback arrives at a service healing event you did not schedule.
Which is why the most interesting mode is full caching, and why its argument is a reliability one. A stateless fleet whose OS disks never touch remote storage in steady state has removed a correlated regional failure from its dependency graph — and that is a reason to use this feature that survives scrutiny, in a way that “it is slightly faster and the disk is free” does not.
The one line to take away
Choose ephemeral only where losing the OS disk mid-flight is a non-event, then set placement explicitly, subtract 1 GiB if Trusted Launch is on, and remember that the local storage left over is the initial size minus the OS image — or nothing at all on single-disk NVMe. If you are doing it for resilience rather than speed, you want full caching, eight vCPUs, and API 2025-04-01.
Next in the series: Generation 1 versus Generation 2 VMs, and Trusted Launch — including the vTPM whose sealed secrets this post just warned you about.
Official Azure Reference
- Ephemeral OS disks for Azure VMs — the local-storage definition and stateless-workload framing, the partial and full caching modes with full caching's 2x local space requirement and 8-vCPU floor, the resilience-during-storage-outage rationale and background caching behaviour, the full caching prerequisites and supported series, the three placement options with their VM generations and the DiffDiskPlacement property, the IOPS sharing behaviour per placement, the complete persistent-versus-ephemeral comparison table covering size limits, data persistence, stop-deallocate, specialized disks, resize, redeploy, page file placement and healing versus Live Migration, the unsupported feature list, the size requirements with the 127-GiB Windows, 30-GiB Ubuntu and 110-GiB NVMe worked examples and the final-size formulas, the smallsize image note, the portal 404 behaviour, the SSD base disk options with their SLA and 8-10x IOPS statements, the Trusted Launch VMGS reservation with its 75-GiB temp disk failure example and vTPM warning, the Confidential VM reservation, and the customer-managed key rotation restriction
- FAQ for ephemeral OS disks — the 2 TiB maximum and local-node write statement, the prohibition on resizing and on changing placement after provisioning, the no-temp-disk-when-sizes-match answer, the NVMe versus temp placement comparison with its D2ads_v5 and D2ads_v6 examples, the multi-disk NVMe behaviour on a D16ads_v6, Spot and low-priority support with delete-instead-of-deallocate, managed data disk attachment, the supported VM size families and the capability-probing PowerShell script, the creation-time-only restriction, the no-mixing-within-a-scale-set rule, and the full caching description, prerequisites, cost and availability answers
- Deploy ephemeral OS disks — the diffDiskSettings property with option Local and the CacheDisk, ResourceDisk and NvmeDisk placement values, the ReadOnly caching requirement, enableFullCaching on API version 2025-04-01 or later, the CLI parameters including --ephemeral-os-disk-enable-full-caching, the Set-AzVMOSDisk and Set-AzVmssStorageProfile PowerShell usage, the portal location of the option and the explanation for it being greyed out, and the REST and portal reimage paths
- Trusted launch for Azure VMs — the supported sizes referenced by the VMGS reservation rules (no claims drawn from it)
- Introduction to Azure managed disks — the persistent OS disk behaviour this post is contrasted against (no claims drawn from it)
Comments