Virtual Machines Scale Set


Virtual Machines Scale Set - Orchestrator for pool of VMs

             
          One of the major benefits of cloud computing is elasticity and scalability to adapt varying workloads by dynamic resource allocation or deallocation. Now consider a situation where we have to host an N tier application in Azure Virtual Machines. For simplicity let’s consider a 3 tier web application having web tier, business tier and database. Now we have a specific set of virtual machines for web tier and business tier hosted behind an Azure load balancer or Application gateway. Now everything works fine till application receives more requests than it can withstand during certain peak business hours or specific days. To cope with such scenario application should scale horizontally or vertically. Either of the ways we have to either manually provision more virtual machines of identical configuration and set up or scale up existing virtual machines. How tedious job would it be for the team to manually handle such situations!

Here comes Azure Virtual Machine Scale Set(VMSS) into picture. Virtual Machine Scale Set is a pool of identical virtual machines running behind load balancer that can be deployed, managed, monitored and scale as a single unit.

What is VMSS 

         Scale Set is an orchestration tool for a collection of identical VMs. As per Azure documentation, scale set lets you create and manage a group of load balanced VMs. It allows you to centrally manage, configure, update and scale a collection of VMs. This is generally useful for large scale compute worker pool, big data and containerized workloads. In fact lots of Azure services including Azure Service Fabric, Azure Batch uses VMSS as underlying service.
There are different means of creating VMSS:

  • Azure portal
  • Azure CLI
  • Azure PowerShell
  • ARM template



VMSS provisions an initial set of virtual machine instances as mentioned by the administrator. All the instances are of same VM size, disk size, configuration and same application is installed having same configuration. All the VMs are connected with each other through a virtual network and subnet configuration. User has the provision to specify network configurations. Also it puts all the instances of virtual machines into a back end pool and configures Azure load balancer or application gateway to load balance all the requests to the available (healthy) instances.

One can definitely argue that the same can be achieved by manually provisioning a set of virtual machines of same configuration and configuring a load balancer or application gateway. Then what is extra with VMSS.

Features of VMSS

            
           Virtual machine scale set can be created and managed using three different ways using Azure portal, Azure CLI and Power shell. Let’s find out the features of VMSS which are either not possible or adds lots of overheads with manually provisioned virtual machines to achieve the same.
  • Identical application instances: Scale set creates VMs using same OS image, same configuration of VM size, disk configuration, network configuration and installs same application in all the instances. This helps to reduce overhead of manually creating identical VMs and eliminates possibility of human error.
  • Traffic is load balanced using Azure load balancer or application gateway.
  • VM instances are automatically distributed across Availability zones or Availability set.
  • Most important feature is scalability. Scaling allows to serve dynamic increase or decrease of user request to application without downtime. There are two types of scaling, i.e., Vertical and Horizontal scale.
    • Vertical scale: Vertical scaling is known as scale up and scale down which deals in resizing VM instances. If we increase or decrease the size of the scale set, it will scale up or scale down all the instances of the scale set to that particular size.
    • Horizontal scale: Horizontal scale is known as scale in and out which deals in increasing or decreasing VM instances count. There are two ways of configuring horizontal scaling either via manual scaling or via custom scaling. Manual scaling allows to scale in or out instances count manually by defining instance count. On the other hand custom scaling allows to scale in or out instance count automatically either depending upon metrics or scheduled scaling configuration.
  • It is possible to monitor health of each instances by enabling application health monitoring.
  • Enabling automatic repair allows unhealthy instances to be replaced with newly provisioned application instance after grace period. This ensures users do not experience downtime as healthy instances will continue to serve requests and meanwhile unhealthy instances are repaired automatically and added back to pool.
  • Automatic OS image upgrade feature upgrades all the VMs in the scale set to latest OS image depending upon upgrade policy opted. This reduces overhead of manually updating each instances and allow users to access application while VM instances are being updated.
  • Enabling monitoring for virtual machine scale set allows to monitor VMs.

Summary

         
         Virtual machine scale set was launched in 2016 aiming to provide an orchestration facility for large set of virtual machines. I hope above discussion sheds some lights on what VMSS is capable of and how it helps to automate managing and scalability of pool of VMs. There are definitely other services as well for orchestrating containerized applications like AKS.

Comments

Popular posts from this blog

HashMap

What is Stream API in Java

HashMap internal working principle