Reveal the Secrets Behind Azure VM Ephemeral Disks!

Ephemeral OS Disks in Microsoft Azure can dramatically improve VM performance while reducing costs. In this post, we’ll explore what they are, why they matter, when to use them, and how to deploy them using the Azure Portal and PowerShell.

What Are Ephemeral OS Disks?

Ephemeral means short-lived. In Azure, an Ephemeral OS Disk is stored on the local temporary storage of the physical host instead of a managed disk. This provides low latency, high IOPS, and zero OS disk cost. However, the OS disk is deleted when the VM is deallocated.

Why Use Ephemeral OS Disks?

They offer faster performance, quicker provisioning, and cost savings. They’re ideal for stateless workloads like scale sets or pooled session hosts in Azure Virtual Desktop.

Limitations and Considerations

When working with ephemeral disks, it’s essential to be aware of the specific restrictions. These limitations include the following:

  • Cannot capture VM image
  • No snapshots
  • No Azure Backup
  • No Azure Site Recovery
  • No Azure Disk Encryption
  • Limited management in the Azure Portal

Additionally, the VM should be provisioned with sufficient local temporary storage to accommodate the operating system image. Generally, this requires 127 GB for Windows environments and 30 GB for Linux systems.

Deploying via Azure Portal

Below are the steps to configure Azure virtual machines through the portal with ephemeral disks. Ensure that the selected VM SKU provides sufficient local temporary disk capacity to meet the operating system requirements.

  1. Create a new VM in the Azure Portal
  2. Choose a VM size that supports Ephemeral OS Disks
  3. Under Disks > Advanced, select Ephemeral OS Disk placement (Temp or NVMe)
  4. Complete the configuration and deploy

Deploying via PowerShell

It is possible to create ephemeral OS disks using PowerShell, Bicep, Azure CLI, or Terraform. The following is a sample Set-AzMVOSdisk command that sets up ephemeral disks on a VM with NVMe temporary storage support. For the complete instructions on creating an Azure VM with an ephemeral OS disk, refer to the GitHub link below.

Set-AzVMOSDisk -VM $vmConfig -Name 'osdisk' -CreateOption FromImage -Caching ReadOnly -DiffDiskSetting Local -DiffDiskPlacement NVMeDisk

Ephemeral OS Disks are a great way to optimize Azure VM performance and reduce costs for the right workloads. Watch the full tutorial video for a detailed walkthrough and best practices.

Links:

A Beginner’s Guide to the AZ-900
https://www.udemy.com/course/beginners-guide-az-900/?referralCode=C74C266B74E837F86969

Zero to Hero with Azure Virtual Desktop
https://www.udemy.com/course/zero-to-hero-with-windows-virtual-desktop/?referralCode=B2FE49E6FCEE7A7EA8D4

Hybrid Identity with Windows AD and Azure AD
https://www.udemy.com/course/hybrid-identity-and-azure-active-directory/?referralCode=7F62C4C6FD05C73ACCC3

Windows 365 Enterprise and Intune Management
https://www.udemy.com/course/windows-365-enterprise-and-intune-management/?referralCode=4A1ED105341D0AA20D2E

PowerShell Commands
https://github.com/tsrob50/CiraltosTools

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Click Here!
Scroll to Top