In this article, we will focus on how to create an Azure Compute Gallery and How to capture images in a Virtual Machine, whether Windows or Linux.
Azure Compute Gallery is a compute service on the Azure portal to, basically, store images associated with a VM and applications which can be shared with other users in your organization, within and across regions within a tenant.
How to create an Azure Compute Gallery
Search for Azure Compute Gallery in the search box on your Azure portal and select the resource
Select "Create" to create a new compute gallery.
The page to input all the details required to set up the gallery will be opened. Have in mind that, you must have a valid subscription to create a compute gallery. Create a new resource group if any was not created before, Give the compute gallery a name and select a region in the Instance details section.
In the Sharing section, you can pick how the gallery will be shared. RBAC is picked. This is a policy picked so that users in this particular group would only have permission to the gallery.
Next is the Tag section. Tag the department in which the billing is associated and click on Review + Create for validation to pass.
Click on Create for the creation of the compute gallery after validation is passed. The deployment process begins.
Select Go to resource, after deployment is completed.
The Azure Compute Gallery is created.
The next sub-section is on how to capture an image on a VM using the Azure portal.
Why do we capture image? This is to provide an output template that can be used to create replicas of a VM and in this process, the virtual hard disks of the VM are copied and replicated as well.
How to Capture an Image
On your Azure portal browse the Virtual Machine section to pick an already created VM. You can check through https://hashnode.com/post/cllgmji6c000608lcg0mud38i or https://hashnode.com/post/cllgm7z7k000h09l4gh120yhn on how to create a Virtual Machine (VM) for both Windows and Linux. While on the VM section, click on any of the VMs you want to capture the image.
On the page for the creation of the image, you would notice that, in the Project and Instance details, the Subscription, resource group and region are already selected because these are already linked to the VM.
Select "Yes, share it to a gallery as a VM image version" to allow your managed image to be replicated globally and maintain the same version
In the Gallery details, I selected the already computed gallery, you can also create a new one if none is in existence.
Next is the Operating system state. There are 2 options here. "Generalized" allows VMs created with this image will require a username and password while "Specialized" does not.
Create the "Target VM definition" by clicking on the "Create new". A page towards the left-hand side is opened. Give the VM image definition a name and click "OK"
On the "Version details", give a version number in a specific manner.
Also, input a date of when the image(s) will be terminated.
The Replication sub-section is next. The purpose of this is to replicate the VM image version in a new region for high availability in case of any form of disaster in any region. You can review and create afterwards to pass validation. Click create after validation is passed.
Immediately after the create button was clicked, there was a notification that the VM was stopped before deployment.
As soon as the deployment is complete, there be a notification to click on "Go to resource". Click on "Go to resource", there your VM is created
In the Overview, it shows that the VM(1) and Virtual Machine Scale Set (VMSS)(2) can be created.
Why VM Scale Set (VMSS)? The mage captured can be used to create a VM scale set. It is created to have multiple instances of VM as a form of load balancing. In order words, when a particular VM's traffic increases, it fails over to another VM so that a VM is not overwhelmed,
I hope you found this article interesting.