How to Create a Virtual Machine Scale Set on Azure

in this article we will be exploring how to create Azure virtual machine scale set (VMSS) and the different types of orchestration mode, the type of scaling and mode of scaling and what a load balancer is and at what point do we need to enable a load balancer.

Introduction to VMSS
Azure Virtual Machine Scale Sets (VMSS) is a unique, innovative service offered by Microsoft Azure, which enables the creation, management, and scaling of a large number of similar or comparable VMs. Using VMSS, you can easily configure a collection of identical, load-balanced VMs. The number of VMs can be increased or decreased in response to demand, and this changes in scaling can be done seamlessly without causing any downtime.

Azure Virtual Machine Scale Sets enables you to create and manage a group of load-balanced VMs. The number of VM instances can automatically increase or decrease in response to demand or a defined schedule. Scale sets provide the following key benefits:

  • Easy to create and manage multiple VMs

  • Provides high availability and application resiliency by distributing VMs across availability zones or fault domains

  • Allows your application to automatically scale as resource demand changes

  • Works at large-scale

Example: Take the case of a popular e-commerce platform during a flash sale or Black Friday event. The traffic surge during these periods is massive and often unpredictable. With Azure VMSS, the site can effortlessly manage this influx by scaling up the number of VMs during high traffic and scaling down during quieter times. This change ensures optimal resource utilization, cost-effectiveness, and most importantly, a smooth user experience.

Creating a Virtual Machine Scale Set You can deploy a scale set with a Windows Server image or Linux image

  1. In the Azure portal search bar, search for and select Virtual Machine Scale Sets.

  1. Select "Create on the Virtual Machine Scale Sets" page.

  1. On the Basics page, under "Project details" select your subscription and resource group. You can create a new resources group if you don't have one created already.

  1. Scale set details: give your virtual machine a name, choose your desired region and availability zone.

    1. Scroll down to the orchestration mode and select "uniform" to enhance large stateless workloads with identical instances.

  1. Scaling: under scaling you can select between manual scaling or auto-scaling base on your need, however for the purpose of this article I will be selecting auto-scaling and it can be configured to your need or leave at its default stage.

  1. Under Instance details, select a marketplace image for Image. Select any of the Supported Distros. However, for the purpose of this article I will be selecting windows 11pro.

  2. Choose the size you want. You can as well click on "See all Sizes" to view all available sizes and make your choice accordingly.

    1. Administrator account section: input your username and password,

      and click on next.

  1. Leave the Spot page in its default state. Click on "Next: Disks>" to direct you to the Disk page.

  1. On the Disk page; you can either leave "OS Disk" at it's default state or change it to your preferable choices. Leave the other categories as default and move to the next page which is the "Networking" page.

  1. Networking; the virtual network will be created by default.

  1. Scroll down to Load balancing and select "Azure load balancer" as your load balancing option.

Create your load balancer by clicking on "Create a load balancer"

  1. On the Create a load balancer page, give it a name and leave it at it's default state. Click on the "Create" button

  1. Next is Management; On the Upgrade policy, click on the Upgrade mode drop-down and select "Automatic", so that instances will start upgrading immediately in random order.

Leave other settings at their default state and

  1. Click on "Next Health"; on Health Enable application health monitoring.

Leave the Advanced and Tags at its default settings and click on "Review+Create"

  1. Review+Create; Once validation is passed, click on "Create"

  2. Your resources will begin to deploy

    1. Once deployment is complete, click on "Go to resource"

  1. Here you have the overview of your virtual machine scale set.

and to view your instances, "Click on Instance"

I hope that this step-by-step guide has provided you with a clear understanding of how to create/deploy a Virtual Machine Scale Set (VMSS).

Orchestration Modes for Virtual Machine Scale Sets in Azure

Scale set orchestration modes allow you to have greater control over how virtual machine instances are managed by the scale set. we have two type of orchestration mode for virtual machine scale set in Azure; (i) Uniform orchestration (ii) Flexible orchestration

(i) Uniform orchestration: Uniform Orchestration is the traditional model of managing VMs in a scale set. All instances in the set are identical, thus ensuring uniform performance and simplifying management. Uniform orchestration 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.

(ii) Flexible orchestration : Flexible Orchestration allows different types of instances within the same scale set. This adds complexity to management but provides flexibility in managing different kind of workloads where different VM sizes may be needed. thus achieving high availability at scale with identical or multiple virtual machine types.

Types of Scaling

Vertical scaling: or scaling up or down, is when you increase or decrease computing power or databases as needed—either by changing performance levels or by using elastic database pools to automatically adjust to your workload demands.

Vertical Scaling refers to adding more resources like CPU, RAM, Storage to existing servers to effectively handle higher workloads per demand. In simple words, Vertical Scaling is like upgrading machine’s processor.

Horizontal scaling: or scaling out or in, where you add more databases or divide your large database into smaller servers, using a data partitioning approach called sharding, which can be managed faster and more easily across servers.

Horizontal Scaling refers to adding additional nodes to a system to distribute the workload. Here, workloads can be divided and processed independently across multiple servers. It offers improved fault tolerance and scalability, as adding more servers increases the system's capacity to handle more requests without overburdening any single server. Horizontal Scaling supports seamless expansion, allowing businesses to easily accommodate additional incoming traffic without any disruptions to the application.

Scaling Mode

Manual Scaling: manual scaling is the process of configuring a scale set to meet an individual or organizational needed manually.

Auto-scaling: Auto-scaling is the process of automatically and dynamically matching resources to meet the performance requirements of a system. As the volume of work grows, apps may need additional resources to maintain the necessary performance levels or meet growing demand. If demand slows down and the additional resources are no longer needed, you can save on cloud spend by having an automatic service in place to de-allocate unused resources.

What is a Load Balancer and at What Point do we need to enable a Load Balancer;

Azure Load Balancer is Built to handle millions of requests per second, an Azure application load balancer distributes incoming traffic among healthy VMs to deliver high availability. Thus in Azure Load Balancer is refers to as efficiently distribution of incoming network traffic across a group of backend servers or resources. Read more about load balancer on Load balancer .

We need to enable a load balancer at the every point were we need optimization of incoming traffic in order to maintain high availability. example is during rush hour of sale or black Friday discount sales in organization such as Amazon, load balancer will help in efficiently distribution of incoming network traffic the website will encounter.

Additional Example is Netflix; This streaming App has millions of users around the world, when an overwhelming request is made by users to access the site, the load balancer queues this request and evenly distributes it across the virtual machines.

0
Subscribe to my newsletter

Read articles from DESTINY CHUKWUEBUKA SAMUEL directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

DESTINY CHUKWUEBUKA SAMUEL
DESTINY CHUKWUEBUKA SAMUEL