DEV Community

Cover image for How to Create an Azure Compute Gallery and Capture the Image of a Virtual Machine Using the Azure Portal
Ibrahim Bio Abubakar
Ibrahim Bio Abubakar

Posted on

How to Create an Azure Compute Gallery and Capture the Image of a Virtual Machine Using the Azure Portal

Introduction

Azure Compute Gallery (formerly Shared Image Gallery) is a powerful tool that allows organizations to manage, share, and distribute custom virtual machine (VM) images across multiple regions in Azure. This feature is handy for enterprises looking to standardize VM deployments, improve image management, and enhance scalability. In this guide, I will walk you through the step-by-step process of creating an Azure Compute Gallery and capturing the image of a virtual machine (VM) using the Azure Portal.


Step 1: Navigate to Azure Compute Gallery

  1. Sign in to the Azure Portal.
  2. In the Search bar, type "Azure Compute Gallery" and select it from the results.

Search for Azure Compute Gallery


3.Click "Create" to start the setup.

select create


Step 2: Configure the Compute Gallery

Once you initiate the creation process, configure the following settings:

  1. Subscription: Choose the Azure subscription where you want to create the gallery.
  2. Resource Group: Select an existing resource group or create a new one.
  3. Gallery Name: Enter a unique and descriptive name for your compute gallery.
  4. Region: Choose the Azure region where the gallery will be hosted.

  5. Click "Review + Create", then "Create" to deploy the Compute Gallery.

Config Compute Gallery

With the above simple steps, we've been able to successfully create an Azure Compute Gallery called "DataDiskGallery". It is now time to capture an image of a VM.


Step 3: Capture an Image of a Virtual Machine (VM)

After setting up the Azure Compute Gallery, follow these steps to capture a VM image:

  1. Navigate to the VM
    • In the Azure Portal, go to Virtual Machines.
    • Select the VM you want to capture - I chose the DataDiskVM1 created in my previous post on this platform

Select VM to capture


  1. Deallocate the VM

    • Click Stop to deallocate the VM.
    • Ensure the VM status changes to Stopped (deallocated).
  2. Capture the Image

    • In the top panel, click on Capture followed by Image.

Selected Capturee

  • On the Basics tab, select an existing resource group or create a new one. Note that the region is automatically set at this stage to be the same as that of the VM we intend to capture.

  • Select the Gallery and Image Definition to store the captured image. Selected the DataDiskGallery created above.

Image description


  • For the Operating System State, I chose Generalized. Which requires a hostname, admin user, password, and other VM-related setup to be completed on the first boot.

  • Create a new Target VM Image definition. Where parameters like VM image definition name, Publisher, Offer, and Stock Keeping Unit (SKU) are configured.

  • Enter a Version number and End of life date of your choice.

  • For the replication of the VM image version. The Default replica count is set to 1. You can decide how many replicas you need.

Target VM definition


  • Click Review + Create, then Create to capture the VM image.

Image description


  • Click Go to Resource to check out the newly captured VM.

Image description


Step 4: Verify and Use the Captured Image

  1. Navigate to Azure Compute Gallery in the portal.
  2. Click on your newly created gallery and verify the captured VM image.
  3. You can now:
    • Use the captured image to create new VMs.

It is important to note that from a captured VM image, one can either create a Virtual Machine or a Virtual Machine Scale Set (VMSS).

There goes our newly created Microsoft compute captured VM.

Image description


Conclusion

Creating an Azure Compute Gallery and capturing a VM image using the Azure Portal is a seamless process that enhances image management and VM deployment. By following the steps outlined in this guide, you can standardize your virtual machines, improve consistency across environments, and streamline cloud operations.

With the ability to store, share, and distribute VM images efficiently, Azure Compute Gallery is a must-have for organizations leveraging Azure for scalable and repeatable infrastructure deployments. Start optimizing your cloud workflows today! 🚀

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay