AWS/Azure/OpenShift

How to use Azure Compute Gallery

computefeature

Have you ever thought of capturing the image of your virtual machine so that you can either share or reuse? Then, Azure compute gallery is a resource that you should not overlook. It should not be a suprise to know that a copy of a whole VM (including any associated data drives) or simply the OS disk, depending on how it was made, is what an image is. The Virtual Hard Drives in the image are copied when you build a VM from it, and the new VM’s disks are made from those copies. The most interesting thing about an image is that you can keep it in storage and use it for countless VM creations if need be. Other articles can be found here: How to install Groovy on Linux and Windows and How to install Googler on a Linux System and How to Install PlayonLinux on a Linux System also How to Configure Windows Sandbox and Linux Shell Scripting: How to write a Shell Script that Counts Lines and Words in a File

Images that can be stored in Azure Compute Gallery

  1. Generalized images: Generalizing is a procedure that purges the VM of machine- and user-specific and generalizing an image in Azure compute gallery is as easy as a push of a button because it is a requirement.
  2. Specialized VMs have not undergone a procedure to eliminate machine particular data and accounts. Additionally, osProfiles are not attached to virtual machines built from specialized images. Therefore, in addition to their advantages, specialized images will also have certain drawbacks.

Benefits of using Specialized Images

  1. VMs and scale sets created from specialized images can be up and running quicker. Because they are created from a source that has already been through first boot, VMs created from these images boot faster.
  2. Any VM built using the customized image that is created from that VM may be logged into using the same accounts that can be used to log into the VM thereby making administration of that VM easier
  3. Can be logged into without Admin username and password

Shareability of images stored in compute galleries

  1. Specific people, groups, or service principals : You may share resources on a very specific level with certain individuals, groups, or service principals using role-based access control (RBAC).
  2. Subscriptions or tenants : Sharing to everyone in a tenancy or subscription is possible with a straight shared gallery.
  3. Anyone: All Azure users may access your whole gallery using the community gallery.

Demo:

  1. Create a Compute Gallery
  2. Create a Resource Group & a Virtual Machine either with cli or from the portal
  3. Take a snapshot of the Virtual Machine and Save the snapshot in the Compute Gallery created
  4. create an image from the image saved in the gallery

1. Azure compute gallery, with these steps

  1. Log in to the Azure portal (https://portal.azure.com/) using your Azure account credentials.
  2. In the search resource, services and docs field, type Azure Compute Gallery
search
type azure compute gallery in search field

2. Select the best option from the search result and hit enter, it would usually be grayed out

Best-option
select best search option

3. create on either of the create buttons

create
Click Create

4. Enter your project details this includes your subscription and your resource group

project-details
Project details

5. Enter your instance details this include Name, location and description of the gallery

instance-details
Instance details

6. Sharing

sharing
Sharing

7. Review to start Validation

review-and-create
review

8. Create

create2

9. Go to Resource to start using Gallery

go-to-resource

10. View Gallery

gallery

2. Create a Resouce group & a Virtual Machine with Cli

Create a resource group first, then proceed to create a VM with Azure Cli using the command below:

 az group create --name techdrg --location EastUS
 
 az vm create \
 --resource-group techdrg \
 --name AMG \
 --image UbuntuLTS \
 --generate-ssh-keys 

The Resource Group should be created first then the virtual machine

resource-group
Resource group

The virtual machine comes next

vm
vm running

Here are the created resource in the portal

cr
created Resource Group & Virtual Machine

3. Save a snapshot of the Virtual Machine in the Compute Gallery

  1. Click on Capture
cc
click on capture

2. Focus on the Gallery detail, select the gallery you created earlier & the operating system state

gd
Gallery Details

3. Create a target VM definition

vm-definition
vm definition

4. Create version detail for your VM

mport
vm definition & version detail

5. Review & Create

freview
Review then create

6. Wait for the deployment to be complete

wait
wait

7. Go to Resource to access newly created image

g2r

8. Image creation succeeded

succeeded
succeeded

4. Create an image from the image saved in the gallery

So you see we have an image in the galllery that can be used to create other images

  1. Click on create VM
Createv

2. from the basics tab, fill in project details and for instance details choose the image from the gallery

image-from-cg
image from compute gallery

2. Admin Details. We can clearly see that the username and password have been grayed out because we choose to have a specialized image during the creation of the compute gallery image

specialed-admin-details
Admin details grayed out

3. Select your inbound port rules, then review and Create

reviewf
review&create

The image has been created, it took a very short time to create

frun
vm from a specializaed image

Summary

Preconfigured virtual machines and apps in the Azure Compute Gallery are available for quick deployment on Azure. Instead of manually installing and configuring the program, users may rapidly spin up a virtual machine with their preferred software by using the gallery. This article have shown steps that can be taken in order to create a compute gallery and also how to create a generalized image and finally create a vm from a generalized image.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x