DEV Community

Cover image for How to Create a VMSS from Captured image on Azure
Kehinde Oloye
Kehinde Oloye

Posted on

How to Create a VMSS from Captured image on Azure

In the cloud tech space, scalability is essential. Whether you're a startup, gearing up for rapid growth or an established enterprise managing variable workloads, Azure Virtual Machine Scale Sets (VMSS) can be a game-changer. This versatile Azure service allows you to effortlessly manage and scale multiple virtual machines (VMs) while ensuring high availability and ease of management.

Today we shall journey through creating a VMSS from a compute gallery in the Azure Portal, unlocking the potential for your applications to scale dynamically.

VMSS and Compute Gallery
VMSS is an Azure service that lets you deploy and manage a set of identical VMs. Combining these two technologies allows you to scale applications horizontally by deploying VMs based on custom images from your gallery.

Azure Compute Gallery is a powerful feature that allows you to create and manage custom virtual machine images. These images can include your desired operating system, applications, and configurations.

See my article to Create Azure Compute Gallery and capture image

Benefit of Azure Virtual Machine Scale Set
Azure Virtual Machine Scale Sets (VMSS) offer several benefits for managing and deploying virtual machines in Microsoft Azure:

  • High Availability
  • Scalability
  • Automatic Updates
  • Custom Images
  • Managed Disks
  • Auto Scaling
  • Integrated Monitoring
  • Cost-Efficiency
  • Ease of Management
  • Rolling Upgrades
  • Template-Based Deployment
  • Integration with Azure DevOps
  • Global Deployment

Before you begin, ensure that you have the following prerequisites in place:

Azure Subscription: You need an active Azure subscription. If you don't have one, you can sign up for a free trial at Azure Portal.

Azure Resource Group: Create an Azure Resource Group to organize and manage your gallery resources.

Azure Compute Gallery: Make sure you have created a compute gallery and have captured the image of the VM you want to scale. Click here to learn how to create a compute gallery and capture a VM.

Creating a VM Scale Set
Login to the Azure Portal home page.
Go to " Azure Compute galleries" where the image is stored.

Image description

Click on Create VMSS

Image description

or Search for VMSS on the search bar above from your Azure portal homepage.

Image description

Click on the create button
Image description

Basics: Fill out the basic information, such as the subscription, resource group, and region. Give your VMSS a unique name.

Image description

Orchestration: The orchestration mode is defined when you create the scale set and cannot be changed or updated later. There are two types in Azure, the Uniform and flexible orchestration. Scale sets with Uniform orchestration is Optimized for large-scale stateless workloads with identical instances while Scale sets with Flexible orchestration is used to achieve high availability at scale with identical or multiple virtual machine types.

Select the 'Flexible orchestration'; With Flexible orchestration, Azure provides a unified experience across the Azure VM ecosystem. Flexible orchestration offers high availability guarantees (up to 1000 VMs) by spreading VMs across fault domains in a region or within an Availability Zone. This enables you to scale out your application while maintaining fault domain isolation that is essential to run quorum-based or stateful workloads.

Image description

Instance Details: Configure instance details, such as the VM image, VM architecture and instance size, select the 'gallery image' you created earlier.

Image description

This will automatically select the VM architecture and VM size that was used in the VM we captured in our compute gallery.

Image description

Administrator Account: This is where you setup the username and password of your VMSS, but because we selected the Specialized operating system state when we captured the VM image it is grayed out because we no longer need authentication when we want to scale out.

Image description

Scaling: Configure scaling options based on your application needs. Select 'Custom scaling' so that you can define scaling rules for automatic scaling. Here we define;

initial instance count to 3.
Image description

minimum number of instances to 1
maximum number of instances to 10
the VMSS to scale out in 5 minutes once the CPU threshold gets to 75% by 2 instances.
the VMSS to scale in, in 5 minutes once the CPU threshold gets to 25% by 1 instances.

Image description

Management: Specify monitoring, diagnostics, and auto-shutdown settings as per your requirements or leave it on default.

Tags: Ensure that your resources are tagged, you can add tags based on your preference.

Image description

Review + Create: Review your settings, and when everything looks good, click 'Create' to deploy your VM Scale Set. This will take a while, once deployment is completed, click on 'Go to resource' to access the newly created VMSS.

Image description

Image description

Go to Resource

Image description

This is the newly deployed Virtual Machine Scale Set, and you can see the initial instance defined during configuration are already running.

Image description

Monitor and Manage Your VMSS

Once your VMSS is deployed, you can use Azure Monitor and Azure Autoscaling to ensure your application scales efficiently and is highly available. Azure Monitor helps you gain insights into your VMSS's performance, while Autoscaling allows you to automate scaling based on metrics and schedules.

Summary

In this comprehensive guide, we've explored the process of creating a Virtual Machine Scale Set (VMSS) from a custom image in Azure Compute Gallery. By leveraging these Azure services, you can optimize the scalability and availability of your applications, ensuring they can handle varying workloads with ease.

VMSS and Compute Gallery are indispensable tools in your cloud infrastructure toolbox, empowering you to deploy, manage, and scale virtual machines efficiently. As you embark on your cloud journey, remember that flexibility and scalability are your allies, and Azure is your trusted partner in achieving your goals.

Embrace the power of Azure VMSS and Compute Gallery to unlock the true potential of your cloud applications. Scale up, scale out, and scale confidently with Microsoft Azure.

Thank you for reading my article till the end. I hope you learned something special today. If you enjoyed this article, then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box.

Top comments (0)