DEV Community

Cover image for Creating and Managing Virtual Machine Images and Scale Sets in Azure: A Step-by-Step Guide
Oladosu Ibrahim
Oladosu Ibrahim

Posted on • Edited on

Creating and Managing Virtual Machine Images and Scale Sets in Azure: A Step-by-Step Guide

Introduction

Azure makes it easy to standardize, replicate, and scale your virtual machines by combining the Azure Compute Gallery with Virtual Machine Scale Sets (VMSS). With this approach, you can capture a pre-configured VM as an image, store it in a Compute Gallery, and then use that image to deploy multiple identical VMs or scale sets in just a few clicks.

In this hands-on guide, we’ll walk through:

  • Creating a Compute Gallery.
  • Saving a VM image to the gallery.
  • Creating a Virtual Machine Scale Set.
  • Configuring scaling to handle demand.

By the end, you’ll know how to efficiently manage reusable VM images and scale resources up or down, depending on your workload.

Skilling Objectives

  • Create an Azure Compute Gallery to store and share VM images.
  • Capture and save an existing VM image for future use.
  • Deploy Virtual Machine Scale Sets (VMSS) from a gallery image.
  • Implement scaling to match workload demand.

Step 1: Create a Compute Gallery

💡 What is Azure Compute Gallery?
Azure Compute Gallery is a service that lets you store, manage, and share VM images across your organization. It works like a central library for reusable VM templates.

Steps:

  1. In the Azure Portal, search for Azure Compute Gallery.
    description 1

  2. Click + Create.
    description 2

  3. Under Resource Group, select IbrahimRG.

  4. Give your gallery a name — e.g., IbrahimGallery.

  5. Click Review + Create, then Create.
    description 3

  6. Once deployment is complete, click Go to resource.

Step 2: Save the VM Image in the Compute Gallery

💡 Why save an image?
Capturing an image allows you to recreate identical virtual machines without manually reconfiguring them every time.

Steps:

  1. Go to your existing VM in Azure.
    description 4

  2. Click Open in Mobile (optional — for easier management on the go) and scan the QR code.
    description 5

  3. In the VM menu, select Capture.
    description 6

  4. For Target Azure compute gallery, select IbrahimGallery.
    description 7

  5. Under Operating System state, choose Specialized.
    ⚠️ This means VMs created from this image will already be fully configured — no need to set hostname or admin credentials.

  6. Click Create new for Target VM image definition and name it ScaleSetVM.

  7. Click OK.

  8. Under Version details, set:

  • Version number: 0.0.1
  • End of life date: 08/31/2025 description 8
  1. For Replication, select Standard HDD LRS.
  2. Click Review + Create, then Create.
    description 9

  3. Once deployment finishes, go to Resource.

Use Cases:

This image can now be used to:

  • Create a New Virtual Machine.
  • Create a New Virtual Machine Scale Set.

Step 3: Create a Virtual Machine Scale Set (VMSS)

💡 What is VMSS?
A Virtual Machine Scale Set is an Azure service that lets you automatically deploy and manage a group of identical, load-balanced VMs. It’s ideal for workloads that need to scale up or down based on demand.

Steps:

  1. In the Portal, click + CreateVirtual Machine Scale Set.
    description 10

  2. Name it IbrahimVMSS.
    description 11

  3. Under Instance count, keep the default value of 2.
    description 12

  4. Under Licensing, select Windows client.

  5. Tick the box confirming you have eligible Windows 10/11 licenses.

  6. Click Review + Create, then Create.

  7. Go to Resource after deployment.

Note: You’ll see that the Administrator Account section is disabled — this is because we used a Specialized image, which comes pre-configured.
description 13

Step 4: Configure Scaling to Meet Demand

💡 What is Scaling?
Scaling is the process of increasing or decreasing computing resources based on workload demand. This ensures performance during peak usage and saves costs during low usage.

Steps:

  1. Inside your VMSS resource, go to Availability + ScaleScaling.
  2. Select Manual scaling.
  3. Increase Instance count to 20 (or another value based on your needs).
  4. Click Save. description 14

Step 5: Confirm the Newly Created VMs

Steps:

  1. From the Azure Portal home page, go to Virtual Machines.
  2. Verify that your VMs from the scale set are being created and running.

Conclusion

In this project, you’ve learned how to:

  • Create a Compute Gallery.
  • Save a Specialized VM image for reuse.
  • Deploy a Virtual Machine Scale Set from that image.
  • Configure scaling to adapt to demand.

These skills are essential for efficient cloud resource management, helping you:

  • Standardize deployments.
  • Save configuration time.
  • Handle variable workloads without over-provisioning.

Whether you’re supporting enterprise applications or experimenting with test environments, this workflow keeps your infrastructure flexible, cost-effective, and ready to scale.

Top comments (0)