Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Azure icon
Labs

Using Ephemeral OS Disks in Azure for Stateless VMs

Azure OS Disks serve as the primary storage for Azure Virtual Machines. Persistent disks provide reliability and robust backup guarantees for stateful VMs, but these disks cost money. If your VM is stateless, however, you can use an ephemeral OS disk, which has no additional storage cost beyond the base compute cost of the VM itself. These ephemeral disks can also be deployed and reimaged more quickly than persistent disks. In this lab, you will have the opportunity to experiment with ephemeral OS disks by building and reimaging a stateless VM.

Azure icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 06, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create the stateless VM.
    1. Log in to the Azure Portal.

    2. Click + Add and add a new Ubuntu Server.

    3. Enter ephemeral-disk-poc for the Virtual machine name.

    4. Select Ubuntu Server 18.04 LTS for the Image.

    5. Click Change size, then select DS1_v2 and click Select.

    If you want to log in using a password, select Password for Authentication type, then supply a username and password. Be sure you remember the password so you can log in later.

    1. Under Disks, click Advanced. Select Yes for Use ephemeral OS disk.

    2. Click Review + create, then Create.

    Wait a few minutes for your VM deployment to finish.

  2. Challenge

    Reimage the VM.
    1. Go the Azure portal. Navigate to your resource group and click on the ephemeral-disk-poc VM. You should see a Public IP Address. Use this, along with the credentials you created earlier, to log in to the VM.

    2. Create some test data in the home directory:

    echo "Hello, World!" > test.txt
    
    1. Verify that the file exists. You should see test.txt listed:
    ls
    
    1. In the Azure portal, navigate to the ephemeral-disk-poc VM.

    2. Click the Reimage button and confirm. Wait a few moments for the reimaging to complete.

    If you still have your ssh session open, it will be closed as the VM shuts down. The newly-imaged VM will have a new host key, which may result in an error if you attempt to log in again. You can avoid this by removing the old host key from your known_hosts file.

    1. Replace <public IP of the VM> with the actual public IP of your VM:
    ssh-keygen -R <public IP of the VM>
    
    1. Log in to the vm again. Check for the test.txt file again. This time, the file will not be present, since the VM has been returned to a clean state.
    ls
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight