The Azure Virtual Machine Scale Set (VMSS) lets you create and manage a group of load-balanced Virtual Machines (VM). The number of VM instances can automatically increase or decrease in response to demand or defined schedules. Scale sets provide high availability to your applications and allow you to centrally manage, configure, and update a large number of VMs. With a VMSS, you can build large-scale services for areas such as compute, big data, and container workloads.
Let’s take a look at the differences between a VM and a VMSS.
Key Differences between Virtual Machines and Virtual Machine Scale Sets
Scale sets are built from VMs. If we want to add additional VM instances, VM Scale sets automatically create it from central configuration, traffic balancing and distribution, high availability and redundancy, and scaling of the VM. These processes are manual for normal virtual machines, which don’t require VMs to be identical.
We need to manually monitor and use Azure automation to scale VMs. For VMSS’, we need to auto-scale is based on host metrics, in-guest metrics, application insights, and schedule.
Azure VMSS provides the management capabilities for applications that run across many VMs, automatic scaling of resources, and load balancing of traffic. Scale sets provide the following key benefits:
- Easy to create and manage multiple VMs
- Provides high availability and application resiliency
- Allows your application to automatically scale as resource demand changes
- Works at large-scale
Easy to Create and Manage Multiple VMs
When you have many VMs that run your application, it’s important to maintain a consistent configuration across your environment. For the reliable performance of your application, the VM size, disk configuration, and application installs should match across all VMs.
With scale sets, all VM instances are created from the same base OS image and configuration. This approach lets you easily manage hundreds of VMs without additional configuration tasks or network management.
Scale sets support the use of the Azure load balancer for basic layer-4 traffic distribution and Azure Application Gateway for more advanced layer-7 traffic distribution and TLS termination.
Provides High Availability and Application Resiliency
Scale sets are used to run multiple instances of your application. If one of these VM instances has a problem, customers continue to access your application through one of the other VM instances with minimal interruption.
You can use Availability Zones to automatically distribute VM instances in a scale set within a single datacenter or across multiple data centers for additional availability.
Allows Your Application to Automatically Scale as Resource Demand Changes
Customer demand for your application may change throughout the day or week. To match customer demand, scale sets can automatically increase VM instances as application demand increases, then reduce the number of VM instances as demand decreases.
Autoscale also minimizes the number of unnecessary VM instances that run your application when demand is low. At the same time, customers continue to receive an acceptable level of performance as demand grows and additional VM instances are automatically added. This ability helps reduce costs and efficiently create Azure resources as required.
Works at a Large-Scale
Scale sets support up to 1,000 VM instances. If you create and upload your own custom VM images, the limit is 600 VM instances. For the best performance with production workloads, use Azure Managed Disks.
Let’s cover a use case regarding how deployed web application on Azure can take advantage of the scale set:
The diagram above shows all search servers need to handle the requests from end-users, meaning these servers have the same characteristics in terms of setup, computing specifications, CPU, memory.
Using VM scale sets, users can spin multiple VMs and not worry about managing each VM separately.
Considering that the traffic hitting the scale set is load-balanced across all the scale set members, higher availability and higher fault tolerance will allow the application to perform better.
Orchestration Modes for VMSS in Azure
VMSS provides a logical grouping of platform-managed virtual machines. With scale sets, you create a virtual machine configuration model, automatically add or remove additional instances based on CPU or memory load, and automatically upgrade to the latest OS version. Traditionally, scale sets allow you to create virtual machines using a VM configuration model provided at the time of scale set creation. The scale set can only manage virtual machines that are implicitly created based on the configuration model.
Scale set orchestration modes allow you to have greater control over how virtual machine instances are managed by the scale set. The orchestration mode is defined when you create the scale set and cannot be changed or updated later. There are two types of orchestration modes in Azure:
- Uniform orchestration
- Flexible orchestration
With uniform orchestration, virtual machine scale sets use a virtual machine profile or template to scale up to desired capacity. While there is some ability to manage or customize individual virtual machine instances, uniform uses identical VM instances.
Individual uniform VM instances are exposed via the virtual machine scale set VM API commands. Individual instances are not compatible with the standard Azure IaaS VM API commands, Azure management features such as Azure Resource Manager, which tags a resource with RBAC permissions, Azure Backup, or Azure Site Recovery. Uniform provides fault domain high availability guarantees when configured with fewer than 100 instances. It’s also generally available and supports a full range of scale set management and orchestration, including metrics-based autoscaling, instance protection, and automatic OS upgrades.
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, including:
- Quorum-based workloads.
- Open-Source databases.
- Stateful applications.
- Services that require High Availability and large scale.
- Services that want to mix virtual machine types or leverage Spot and on-demand VMs together.
- Existing Availability Set applications.
Deploying VMSS Using ARM Template
What’s an ARM template, you ask? To provide some background, Azure is managed using an API. Still, it was originally managed using the Azure Service Management API or ASM, which controls deployments of “Classic.” Still, the Azure Resource Manager or ARM API replaced this API. The resources that the ARM API manages are objects in Azure such as network cards, virtual machines, hosted databases.
Benefits of ARM API
ARM API allows you to deploy several resources together in a single unit and when the deployments are an idempotent script type in Azure. The user can declare the type of resource, what name to use, and which properties it should have. The ARM API will create a new object that matches those details or change an existing object with the same name and type to have the same properties.
A VMSS allows you to deploy and manage a set of auto-scaling virtual machines. You can scale the number of VMs in the scale set manually or define rules to autoscale based on resource usages like CPU, memory demand, or network traffic. An Azure load balancer then distributes traffic to the VM instances in the scale set.
ARM templates let you deploy groups of related resources. In a single template, you can create the VMSS, install applications, and configure autoscale rules. With the use of variables and parameters, this template can be reused to update existing or create additional scale sets. You can deploy templates through the Azure portal, Azure CLI, Azure PowerShell, or continuous integration/continuous delivery (CI/CD) pipelines.
In the diagram below, we can see how the Azure ARM template is used to deploy VMSS.
Let’s see what deploying a VMSS needs from the Azure portal:
From the Azure Portal, select the “Virtual Machine scale set” service:
Fill in the name of the VMSS along with the name of the administrator account on the VMs:
Specify the “DNS label” assigned to the public IP.
Specify the number of instances in the scale set. Scaling can be set to “manual” or “custom.”
Finally, check your configuration and create the VMSS:
Azure Knowledge in Minutes
Now you know about Azure VMSS and the differences between a virtual machine and VMSS. The VMSS instances can automatically increase or decrease in response to demand or a defined schedule and provide high availability to your applications, and allow you to centrally manage, configure, and update a large number of VMs. This is something only a cloud platform can provide with ease. For more information on Azure services, contact our experts today.