DEV Community

Cover image for AZURE COMPUTE GALLERY AND VIRUAL MACHINE SCALE SET
Victoria Oludamilola Oyewole
Victoria Oludamilola Oyewole

Posted on

AZURE COMPUTE GALLERY AND VIRUAL MACHINE SCALE SET


What is Compute Gallery?

Azure Compute Gallery (formerly known as Shared Image Gallery) is a feature in Microsoft Azure that helps you manage and distribute custom virtual machine (VM) images efficiently across your organization. It allows you to create, share, and maintain versions of images, making it easier to scale deployments and ensure consistency across your VMs.It is also an infrastructure as a service.

Key Features of Azure Compute Gallery:

  1. Custom Image Management:

    • You can create and store custom VM images for reuse across multiple deployments.
    • Supports creating multiple versions of an image to manage updates and rollbacks.
  2. Image Sharing:

    • Images can be shared across subscriptions, regions, or with other Azure tenants.
    • Facilitates collaboration and standardization across teams.
  3. Scaling Deployments:

    • Distributes images to multiple Azure regions, enabling quicker VM deployments globally.
    • Replicates images across regions, ensuring high availability.
  4. Consistency:

    • Ensures uniform configurations by using the same image across different environments (e.g., development, testing, production).
  5. Efficiency with Image Replication:

    • Optimized for faster image replication, improving the performance of large-scale deployments.
    • Reduces storage costs by eliminating the need to maintain separate copies for each region.
  6. Support for Multiple Resource Types:

    • You can store and distribute virtual hard disks (VHDs), managed images, and custom VM configurations.
  7. RBAC Integration:

    • Integrates with Azure Role-Based Access Control (RBAC) for secure sharing and management of images.

Typical Use Cases:

  • Standardized VM Deployments: Ensure all VMs in your environment are built from consistent base images.
  • Global Applications: Distribute custom VM images across regions for global applications to minimize latency.
  • Multi-Subscription Management: Share custom VM images across multiple subscriptions within an organization.
  • DevOps Pipelines: Automate VM image creation and sharing as part of CI/CD pipelines.

By using Azure Compute Gallery, organizations can simplify image lifecycle management, improve deployment times, and maintain operational consistency.

What is Virtual Machine Scale Sets?
Azure Virtual Machine Scale Sets (VMSS) is a service in Microsoft Azure that allows you to deploy and manage a group of identical, load-balanced virtual machines (VMs). It is designed to automatically scale the number of VMs in response to demand or schedule, making it ideal for scenarios requiring high availability and scalability.

Key Features of Virtual Machine Scale Sets

  1. Automatic Scaling:

    • VMSS can automatically scale the number of instances based on CPU, memory, or custom metrics using Azure Monitor autoscale rules.
    • Supports scaling out (adding VMs) and scaling in (removing VMs) based on demand or a predefined schedule.
  2. Load Balancing:

    • Integrated with Azure Load Balancer or Azure Application Gateway to distribute traffic evenly across VMs.
    • Ensures high availability and fault tolerance.
  3. Uniform or Flexible Orchestration:

    • Uniform orchestration mode: All VMs in the scale set are identical, ideal for stateless workloads.
    • Flexible orchestration mode: Allows running VMs with varied configurations, suitable for stateful or mixed workloads.
  4. Integrated Updates:

    • Facilitates rolling updates to minimize downtime while upgrading or patching VMs.
    • Supports versioning when used with Azure Compute Gallery to deploy specific image versions.
  5. High Availability:

    • Distributes VMs across Availability Zones or Fault Domains for resilience against hardware or data center failures.
  6. Custom Images and Extensions:

    • Use custom VM images from Azure Compute Gallery.
    • Configure VMs with extensions for software installations and custom scripts during deployment.
  7. Multi-Region and Cross-Zone Deployment:

    • Deploy VMs across regions or zones to meet redundancy and low-latency requirements.
  8. Support for Spot VMs:

    • Cost-efficient option for running interruptible workloads by using Azure Spot instances within scale sets.
  9. DevOps and Automation:

    • Integrated with Azure DevOps, CI/CD pipelines, and Infrastructure as Code (IaC) tools like ARM templates, Terraform, or Bicep.

Typical Use Cases

  1. Web Applications:

    • Host large-scale web apps or APIs with automatic scaling to handle varying traffic loads.
  2. Big Data and Batch Processing:

    • Run parallel batch jobs or distributed data-processing workloads with dynamic scaling.
  3. Microservices:

    • Deploy containerized applications where each VM can host containers with Kubernetes or other orchestrators.
  4. High-Performance Computing (HPC):

    • Scale up/down compute power for intensive workloads like simulations or AI/ML model training.
  5. Cost Optimization with Spot VMs:

    • Use Spot VMs for non-critical workloads to save costs.

Advantages of Virtual Machine Scale Sets

  • Elasticity: Automatically adjusts resources to match demand, optimizing performance and cost.
  • High Availability: Redundant VMs ensure minimal downtime during failures.
  • Centralized Management: Simplifies operations by managing identical VMs in a group.
  • Global Reach: Facilitates seamless deployment across multiple Azure regions and zones.

In summary, VMSS is a powerful tool for building scalable, reliable, and cost-effective applications in Azure. It is particularly suited for workloads requiring dynamic scaling or high fault tolerance.
.

The Steps on Azure compute Gallery and Virtual Machine Scale Set

                     (part 1)
Enter fullscreen mode Exit fullscreen mode
  • Log into your Azure Account.

Image description

-Search at the tool box, Select and Create a Virtual Machine.

Image description

-If you have a Virtual Machine been created, you can start it again.

Image description

  • In the search bar, search for Settings and Select Disk. There is OS(Operating Disk) Disk and Data Disk. It is on the Data Disk we want to work to generate space due to the Image wanted to be stored.

Image description

  • Click on the Data Disk section, and generate number of disk wanted ** (LUN), ** Name of Disk (datadisk), Storage type(choose standard SSD) for smooth and faster running of the system and Size GiB (the memory of the disk needed). leave everything as default and then, Apply the rule.

Image description

  • A Disk has been attached.

Image description

  • Go to the Overview page.

  • Go to the search bar and select Connect

Image description

  • Select the Connect Icon and on the Native RDP button, select the *Select button.
    *

    Image description

  • The selection of the select button opens the RDP page, where the configured button will clicked and Download RDP will be clicked.

Image description

  • Downloading of the RDP file to connect the Virtual Machine

Image description

  • In the VM environment, search for Disk Management, click on it, it will give you the environment below. Click on OK to initialize what has been created.

Image description

Click on the data disk created, right click on it, you will find "New Simple Volume Wizard", click on the next button

Image description

  • Keep on clicking on the next button until you find this area that identifies the partition of the disk. Give it name like data disk. click on the next button to finish the process.

Image description

  • In the interphase below, the partition is done, click on the *Finish button. Then the disk is useable. *

Image description

                           Part 2

                 Azure Compute Gallery Creation
Enter fullscreen mode Exit fullscreen mode

Azure Compute Gallery (formerly known as Shared Image Gallery) is a service in Microsoft Azure that simplifies the process of sharing and managing images for virtual machines (VMs) at scale. It enables you to create, manage, and replicate VM images efficiently across multiple regions and subscriptions.

The Procedures;

  • Log into your Azure account and search for Azure Compute Gallery, it's an application on it's own in Azure.

Image description

  • Select + Create button

Image description

  • Create the Resource Group, Give it the name, Description and select Review + create.

Image description

  • Go back to the VM created and select Capture.

Image description

  • On the Capture button select the Image icon

Image description

  • While creating the Compute Gallery Resource Group, make sure that the Virtual Machine Resource Group are the same with it.

Image description

  • However, while creating the Compute Gallery and and capturing the Image on the virtual Machine, for the Operating System State there is an option of Generalized and Specialized. Choosing the option of Generalized will make people attached to it's usage will be asking of the username and password consistently. But a Specialized will automatically log into site.

Image description

  • The next step is, click on Target the VM Image Definition, it will pop up the box beside it with the title Create a VM Image Definition, write the VM image definition name and click on OK

Image description

Image description

  • While an image is being created, the Image creation will stop the Virtual Machine that is running before the its creates the image.

Image description

  • Moreso, in Virtual Machine Scale Set process, there is what is called Horizontal Scaling. That is, when the traffic is too much, such that, when the number of people wanting to log into an app is to much, the scaling out occur(scaling out number of VMs) so that, there will many instances of VMs. When the number reduced, it scales in and shut down the number of VMs that have been created.

USING THE IMAGE CREATED TO CREATE A VIRTUAL MACHINE

  • Go to resource after the deployment of the the Capture Image.

Image description

  • Click on + Create VM button

  • Creation of Instances Details

Image description

  • The Image created is part of the image instances.

Image description

                          PART 3
            HOW TO CREATE VIRTUAL MACHINE SCALE SET
Enter fullscreen mode Exit fullscreen mode
  • Go to the Resource of the Azure Gallery created, select + create VMSS icon

Image description

  • Create the VMSS name.

Image description

  • Choosing of Orchestration Mode

Orchestration Mode is the kind of mode a virtual machine scale sets want to operate on. Choose how virtual machines are managed by the scale set. In flexible orchestration mode, you manually create and add a virtual machine of any configuration to the scale set. In uniform orchestration mode, you define a virtual machine model and Azure will generate identical instances based on that model.

It is in two part;
Flexible: achieve high availability at scale with identical or multiple virtual machine types.
Uniform: optimized for large scale stateless workloads. Being stateless means, when something doesn't store information about what it did.

Image description

  • Scaling: choosing manual scaling up of VM when the users number grown.

Image description

  • Click on** Review + create button*, then **create*

Image description

  • Go to Resource

Image description

  • GO to Scaling Icon to scale up the VM manually to many instances in need. And save.

Image description

Image description

  • Go back to the Virtual Machine icon to see the numbers of instances selected to be created and it has been created.

Image description

Top comments (0)