How to Create and Deploy a Virtual machine Scale Sets.

How to Create and Deploy a Virtual machine Scale Sets.

Virtual machine scale set supports easy creation and management of multiple VMs, ensuring consistent configuration across your environment. It’s key benefits are high availability across availability zones or fault domains, Automatic scaling as resource demand changes, flexible orchestration for a unified experience across the azure ecosystem, easy management of hundreds of VMs without extra configuration tasks or network.
ORCHESTRATION MODE
Azure Virtual Machine Scale Sets (VMSS) offer two types of orchestration modes, each designed to manage VM instances in different ways:

Uniform Orchestration Mode: This mode is optimized for large-scale stateless workloads with identical instances. VMSS with Uniform orchestration use a VM profile or template to scale up to the desired capacity. While there is some ability to manage or customize individual VM instances.

Flexible orchestration mode: Flexible Orchestration Mode in Azure Virtual Machine Scale Sets (VMSS) is designed to provide high availability and scalability for a diverse range of virtual machine types and workloads.

SCALING MODE AND SCALE-IN POLICY
The scaling mode is about how the VMSS is set up to manage VMs and scale them, while the scale-in policy is about the specific method used to decide which VMs to remove when scaling in. It’s important to choose the right configurations based on your application’s requirements for scalability, availability, and management.

LOAD BALANCER
A load balancer is a system that distributes incoming network traffic across multiple servers to ensure no single server bears too much demand. By balancing the workload. we need to enable the load balancer when Traffic Volume Increases, High Availability is Required, Scalability, Performance Optimization.

Lets get started

Please follow the steps below to create your Virtual machine scale sets

SIGN IN TO AZURE PORTAL
Before beginning, ensure you have an Azure subscription. If not sign up to establish a complimentary account. Once your Azure subscription is active, proceed by logging into the Azure portal with your email and password.

To get started, you’ll need an Azure subscription. If you haven’t got one yet, you can sign up for a free account. After setting up your Azure subscription, you can begin by signing into the Azure portal with your email and password.

CREATE VIRTUAL MACHINE Scale Sets.
a. Type virtual machine scale sets in the search bar

b. In the search outcomes, choose “Virtual Machine scale sets” as your resource from the displayed options.

c. Click on the "Create" button

PROJECT DETAILS

d) You will be directed to the "Basics" page.

Under the project details section, we have the subscription and resource group.

a) Subscription

An Azure subscription essentially serves as a pass giving user access to Microsoft Azure’s services. it requires a membership with a service provider or enrolling in a subscription model. This subscription allows users or businesses to utilize Azure’s diverse offerings, incurring charges based on the chosen subscription tier. Azure also presents complimentary and trial memberships, allowing for a test run of its features prior to opting for a paid plan.

b) Resource Group

Think of a resource group in Azure as a filing system that assists in categorizing and overseeing various assets, like virtual machines and databases, within Azure’s cloud infrastructure.

Consider a scenario where you have a disorganized wardrobe . Locating a specific cloth can be difficult. Here, the wardrobe symbolizes your Azure cloud space, and the cloth represent your resources. If you decide to sort out the wardrobe, placing cloths into designated sections, you create an orderly environment. Similarly, a resource group in Azure compartmentalizes related resources, streamlining the process of managing and accessing them.

SCALE SETS DETAILS
e) In the scale set details we have the virtual machine name, region , availability zone and orchestration .

a) Choose a preferred name for your virtual machine.

b) In the region section, select the location you want your virtual machine to be.

A region in the cloud services like Azure is essentially a designated area that houses data centres. These data centres provide the necessary infrastructure and services. Each region functions autonomously, equipped with its own resources and infrastructure to ensure self-sufficiency.

c) Next, click on the drop-down to select your availability option and availability Zone.

In Azure, a region can consist of three availability zones, known as Zone 1, Zone 2 and Zone 3. Each zone has one or more data centres that are kilometres apart from each other.

These data centres feature autonomous systems for power, network, and cooling to reduce the effects of outages and disturbances. The physical connection between these data centres is achieved through Fibre Optic Cables. This technology enables the rapid transfer of data across extensive distances, ensuring minimal delay and maximum data transfer capacity.

During a zonal disruption, the virtual machines in the impacted zone might lose connectivity. However, those in other zones will continue to function normally. To compensate for the loss, you can expand the scale set’s capacity, which will provision additional virtual machines in the operational zones. Once the affected zone is back online, it may be necessary to reduce the scale set back to its initial size. Implementing auto scale rules that monitor CPU or memory metrics allows the scale set to automatically adjust, adding new virtual machines in the active zones to replace those lost in the outage.

SCALING
Scaling in Azure Virtual Machine Scale Sets (VMSS) refers to the ability to adjust the number of VM instances automatically or manually based on your application’s needs. Here’s a breakdown of how scaling works in VMSS. for the purpose of this blog i will be using Autoscaling .
f) Select Autoscaling
a) Go to scaling configuration and click on configure.

b) click on the highlighted button

g) On the scaling condition page, select autoscaling and choose your initial instance count
a) Go to instance limit then, choose your minimum and maximum count of instances
b) Go to scale out then, choose your CPU threshold greater than and increase instance count by.
c) Go to scale in choose your CPU threshold lesser than and decrease count by

d) Choose your query duration and click save.

h) On the scaling configuration , click on save.

INSTANCE DETAILS
I) Select your preferred image
a) Select the size of your virtual machine scale sets
b) Go to administrator account , select password and enter a proffered username and password then click Next: spot>

j) Leave the spot section, leave it on default and click Next: Disks>

k) Leave the disk section on default and click Next: Networking >

L) Under networking section , go to load balancing
A Load Balancer in the context of Azure Virtual Machine Scale Sets (VMSS) is a networking component that distributes incoming network traffic across multiple VM instances. This ensures that no single VM is overwhelmed, providing high availability and resilience to your applications.
a) select azure load balancer and click on create load balancer

b) Give your load balancer a name and leave the remaining configuration on default
c) Click on create

m) Once you can see your newly created load balancer , click on Next: management>

n) On the management section, leave configuration on default and click Next : health>

o) On the health section go to enable application health monitoring and select the highlighted box then click on review and create.

p) Once your validation has passed, click on create.

q) Once the deployment is completed, click on go to resource

r) Go to status to see the number of instances that you have successfully created .

s) Click on instances to see the names and status of your instances.

I hope this step-by-step tutorial helped you create and deploy a Virtual machine scale sets. Thank you