DEV Community

Cover image for Step-by-Step Guide to Azure Compute Gallery and Capturing a VM Image
Kosisochukwu Ugochukwu
Kosisochukwu Ugochukwu

Posted on

Step-by-Step Guide to Azure Compute Gallery and Capturing a VM Image

Introduction

Azure Compute Gallery (formerly Shared Image Gallery) enables customers to manage, share, and replicate VM images across regions. This guide describes how to capture an image of a specialized VM, configure Azure Compute Gallery, and deploy VMs using the image that was captured.

Step 1: Create an Azure Compute Gallery

  • Sign in to Azure Portal: Navigate to Azure Portal and sign in.

sign in

Navigate to Compute Galleries:

  • Search for "Azure Compute Gallery" in the Azure Portal.

Azure Compute Gallery

  • Click "Create".

Create
Configure the Gallery:

  • Choose a resource group.
  • Enter a name for the gallery and region.
  • Click "Review + Create" → "Create".

Review + Create

Create

  • Wait for Deployment in progress to finish

Deployment

  • Azure compute gallery created: Now we can create and deploy custom images.

create and deploy custom images

Step 2: Capture an Image of the VM (Specialized State)
Select the Virtual Machine:

  • Go to "Virtual Machines" and choose the VM you want to capture.
  • Ensure the VM is in a stopped and deallocated state otherwise the VM will automatically stop while in the process of deployment.

Create an Image:

  • In the VM overview page, click Capture.
  • Choose Capture an image of this VM.

Capture an image of this VM

  • Under "OS state", select Specialized (since the VM is not generalized).

Specialized

  • Azure Compute Gallery: Choose vmcomputegalleries we created as the target destination.

target destination

  • Create an Image Definition
  • Click "Create" → "Image Definition"
  • Enter a name and choose the operating system.
  • Select the VM generation (Gen1 or Gen2).
  • Leave everything else as default and click ok.
  • Choose "Specialized" under "OS State".

name

name for the image

  • Note that it inheriting of the properties of the VM created earlier

inheriting of the propertie
Create an Image Version

  • Version number: Choose 0.0.1
  • End of life: choose any date you prefer

choose any date you prefer

  • Define replication regions (optional for redundancy).

replication regions

  • Click "Review + Create" → "Create".

Review + Create

  • Notice the VM being stopped as the validation is in progress

validation

Image description

  • Deployment is complete.

Image description

  • Then go to resource

go to resource

Notice we can use a captured image on compute gallery to create a VM and a VMSS (virtual machine scale set)

I wish to further show you something very interesting

  • Click on create VM

create VM

  • Scroll down to image and notice that the one we just created is listed among the availiable images

availiable images

Conclusion

By completing these steps, you have successfully created an Azure Compute Gallery, captured a specialized VM image, and deployed new VMs from it. This technology allows for effective management and distribution of virtual machine images while keeping user setups and settings.

Top comments (0)