Azure Virtual Machine Scale Set (VMSS).

Azure Virtual Machine Scale Set (VMSS).

Your Sure Plug to High Scalability and Availability in Your Business Operational Activities.

Welcome to today's learning on the Tech Merchant Blog. In our last learning, we looked into the scenario of a business that needs to maintain consistency in the operational delivery across different locations and we looked into how Azure Compute Gallery could be used to capture an Image of a VM that could be used to deploy a business operational application that could be duplicated in other region.

In Today's learning, we are looking at the Virtual Machine Scale Set (VMSS) which is a complementary Azure service or resource to Azure Compute Gallery.

What is a Virtual Machine Scale Set (VMSS)

It is a high-availability service provided by Microsoft Azure that enables you to deploy and manage a group of identical virtual machines (VMs) as a single unit. VMSS is designed to simplify the deployment and management of applications that require scalability, high availability, and load balancing.

Why use Virtual Machine Scale Sets?

To provide redundancy and improved performance, applications are typically distributed across multiple instances. Customers may access your application through a load balancer that distributes requests to one of the application instances. If you need to perform maintenance or update an application instance, your customers must be distributed to another available application instance. To keep up with extra customer demand, you may need to increase the number of application instances that run your application.

Azure Virtual Machine Scale Sets provide 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:

  1. Scalability: VMSS allows you to automatically adjust the number of VM instances in the scale set based on metrics like CPU utilization, memory usage, or custom-defined application metrics. This automatic scaling ensures that your application can handle varying workloads efficiently.

  2. Load Balancing: VMSS instances are automatically load-balanced, distributing incoming network traffic across all VM instances in the scale set. This helps improve the availability and performance of your application.

  3. High Availability: VMSS distributes VM instances across multiple fault domains and updates domains to ensure high availability. In the event of hardware failures or planned maintenance, your application remains accessible.

  4. Rolling Updates: You can perform rolling updates on VMSS instances to apply OS updates, security patches, or application changes without causing downtime. VM instances are updated in small batches to maintain application availability.

  5. Custom Images: You can create custom VM images with the desired configuration and software stack, which can be used to deploy VM instances within the scale set. This allows you to maintain consistency across VM instances.

  6. Automatic Instance Replacement: VMSS monitors the health of individual VM instances. If an instance becomes unhealthy due to application issues, it can be automatically replaced to maintain the desired level of availability.

  7. Integration with Azure Services: VMSS integrates seamlessly with other Azure services like Azure Load Balancer, Azure Monitor, Azure Auto-Scaling, and Azure Virtual Network, allowing you to build comprehensive and resilient cloud applications.

  8. Stateless Workloads: VMSS is particularly well-suited for stateless workloads like web applications, microservices, and batch processing, where multiple identical instances can serve requests independently.

  9. Global Deployment: You can deploy VMSS instances in multiple Azure regions to build globally distributed applications, ensuring low latency access for users worldwide.

  10. Cost Optimization: VMSS helps optimize costs by automatically scaling down during periods of low demand and scaling up when demand increases, ensuring that you only pay for the resources you need.

Azure Virtual Machine Scale Sets provide a powerful tool for achieving scalability and high availability for your applications in the Azure cloud. They simplify infrastructure management and allow you to focus on delivering a reliable and performant application to your users.

Steps By Steps Guidelines on How To Create Azure VMSS.

In creating a VMSS in the Azure environment, you need to have the following prerequisites.

  1. A parent Virtual Machine

  2. A compute gallery with the captured image of the Virtual Machine.

Click on Gallery on the Azure portal.

Look out for the image definition of the parent VM that was created in the gallery and click.

Look out for "Create VMSS" and click.

On the Project detail part, Look out for the subscription and resource group in which you have your Virtual Machine and select.

Move to the Scale set details part and give a name to the VMSS, Select the region and availability zone(s) you want the VMSS located.

Move to the Orchestration session and select the flexible orchestration option. It is important to understand the differences and implications of each of the orchestration options.

Scale sets with Uniform orchestration

In this mode, Virtual Machine Scale Sets use a VM profile or a template to scale up to the desired capacity. While there is some ability to manage or customize individual VM instances, Uniform uses identical VM instances. These instances are exposed through the Virtual Machine Scale Sets VM APIs and are not compatible with the standard Azure IaaS VM API commands. Since the scale set performs all the actual VM operations, reservations are associated with the Virtual Machine Scale Set directly. Once the scale set is associated with the reservation, all the subsequent VM allocations are done against the reservation.

Scale sets with Flexible orchestration

This scale set option helps achieve high availability at scale with identical or multiple virtual machine types. 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, 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 Spot and on-demand VMs

  • Existing Availability Set applications.

It is also important to note that the orchestration mode is defined when you create the scale set and cannot be changed or updated later.

Scroll down to the "Instance Details" part and take note that the image definition of the VM captured in the gallery has been included in the drop-down of the Image. Ensure you select the option of the excelGallery image.

On the part of the size, choose to ensure that the option selected is suitable for business needs.

In the Administrator Account session, you will notice that Administrator profiling was blank out. This is because we chose a specialised operating system when we were creating the compute gallery.

On the Spot page, Leave everything to default.

Leave every configuration here to default.

Leave the virtual network configuration to default and scroll down to create a load balancer for the VMSS.

What is a Load Balancer in VMSS Creation:

Azure Load Balancer is a highly available and scalable network load-balancing service provided by Microsoft Azure. It plays a crucial role in distributing incoming network traffic across multiple virtual machines (VMs) or instances to ensure the high availability, reliability, and scalability of applications hosted on Azure. Azure Load Balancer is a critical component for ensuring the availability and scalability of applications and services hosted on the Azure cloud platform. It can be used for a wide range of scenarios, from web applications to multi-tiered architectures, and helps maintain a high level of service availability for your applications. Scroll down to create a load balancer.

Depending on the source of traffic to your Azure resources, Select Public if the traffic would be from an external source and Internal if the traffic is within a private LAN environment.

Leave other configurations to default.

Select Create and move to the scaling page. On the Scaling policy option, select custom scaling policy to enable auto-scaling of instances based on metrics that will be predetermined. Otherwise, choose the Manual scaling policy option.

Select the determinant metric in situations that would warrant either scaling in or out accordingly.

Make other configurations based on your unique scenario and click on next to access the management page.

Leave every configuration to default and click next to the health page.

On the Health page, allow for application health monitoring and automatic repairs accordingly and click on next to access the advanced page.

Leave everything here to default and click on review and create.

Upon successful review, click on Create.

Click on Go to Resources to access the VMSS.

You have your VMSS created.

Compare the configuration of your VMSS with that of the Parent Virtual machine to ensure that they have similar configuration. You can do this by checking if the data disk in the parent VM is also available in the VMSS.

All thing being equal, you should have the same configuration on both the Parent VM and each of the Instances in the VMSS.

This is the end of the Virtal Machine Scale Set learning. I hope you found this learning informative. Stay tune for other Intersting and informative topic on Azure cloud infrastructure.