Virtual Machine Scale Set
Virtual Machine Scale Set

Linux Virtual Machine Scale Set Creation and Connection

Overview

Linux Virtual Machine Scale Set (VMSS) allows you to deploy and manage a group of identical, auto-scaling virtual machines (VMs). VMSS ensures high availability and makes it easy to scale in or out based on demand. This is particularly useful for applications requiring high availability and the ability to handle fluctuating workloads. VMSS also optimizes costs by charging only for the resources you actively use.

Prerequisites for Linux VMSS

Before proceeding, ensure you have the following:

  1. Azure Subscription: An active Azure subscription. If you don’t have one, create a free account here.
  2. Basic Azure Knowledge: Familiarity with Azure concepts like virtual machines, networking, and resource groups.

Steps to Create and Connect to a Linux VM Scale Set

Step 1: Sign in to Azure Portal

  1. Open the Azure portal at portal.azure.com.
  2. Log in using your Azure credentials.
Virtual Machine Scale Set

Step 2: Create the Linux Virtual Machine Scale Set

  1. In the search bar, type VMSS and select it.
Virtual Machine Scale Set

2. Click +Create

Virtual Machine Scale Set

Configure the Basics Tab

The first step in creating a Linux VMSS is to configure the Basics tab, and provide the following details:

  • Subscription: Select your active Azure subscription.
  • Resource Group: Choose an existing resource group or create a new one. We’ll be creating a new one.

  • Name: Enter a name for your scale set(CloudOpsVMSSRg).
  • Region: Choose East US from the dropdown.
  • Availability Zones: Select None.
  • Orchestration: For orchestration mode, choose Uniform.

Orchestration and Scaling

A scale set has a “scale set model” that defines the attributes of virtual machine instances (size, number of data disks, etc). As the number of instances in the scale set changes, new instances are added based on the scale set model.

  • Under Orchestration mode, define scaling conditions by selecting Uniform
  • Security type: Choose Standard from the dropdown
  • Under scaling, we choose autoscaling as our scaling mode for this Lab and click on Configure to edit the default scaling configuration.
Virtual Machine Scale Set

Scaling conditions

Configure scaling conditions by editing the existing default condition, and if needed, add more conditions for more customized scaling. For this Lab, we’ll edit the default conditions.

Click on the pencil icon to edit the default conditions.

To edit the default conditions, use the settings as they appear in the diagram below:

  • Default instance count: Set the default instance count to 2.
  • Instance limit: For Instance limit set the minimum to 1 and maximum to 5.
  • Complete the edit as shown below and click Save to continue
Input Scaling Configuration

For scale-in policy,

To configure the order in which virtual machines are selected for deletion during a scale-in operation, select “Oldest VM- Balance across zones then delete the oldest created VM” from the drop-down and then click Save

Configure Instance Details

Instance Details

  • For the image, select “Ubuntu Minimal 22.04 LTS – x64 Gen2
  • For size, select “Standard_DC1s_v3 – 1 vcpu, 8 GiB memory ($70.08/month)”
  • Set Username as azureuser
  • And select

Configure Administrator Account

  • Choose the Authentication type as “SSH public key” and for SSH public key source, select Generate new key pair from the drop-down.
  • Ensure the SSH Key Type is set to RSA SSH Format
  • Click: Next: Spot> to continue

Here, in the Spot Tab, leave things as they are and lick Next:Disk> to continue

Next:Disk>

Next: Networking>

For the Virtual network configuration, the Virtual network and Subnet should be left as default.

Under the Network interface, click on the pencil icon to edit the setting

Edit network interface

  • For Load balancing options select/choose Azure load balancer
  • Under Select a load balancer, click on Create a load balancer

Create a load balancer

Use the diagram below as a guide to create a load balancer click on Create. Once the load balancer details have been filled in, click on Create. The next thing is to click on the Review + Create button.

Once validation is passed, click on Create to create the VMSS

Download the Private Key and Create a Resource

Deployment in Progress

Once you click on Download the Private Key and Create a Resource, deployment of the VMSS begins.

Once deployed, click on Go To Resource

Explore Your VMSS

Feel free to explore your Virtual Machine Scale Set as seen in the image below.

Click on Instances to Explore

Clicking on the Instances menu allows you to see how many VMSS you have created. In this case, we have one VMSS.

Connect To VMSS

To connect to the VMSS, go to the Networking menu on your VMSS overview page. Click on load balancing. Now, click on vmss-lb to go to the next page.

Configure high availability and scalability for your applications

Scroll down the vmss-lb page and click the View Inbound NAT rules.

Run Command Prompt

Run The Sudo Apt Update

Conclusion

You’ve successfully created and connected to a Linux Virtual Machine Scale Set in Azure. This scalable and cost-efficient solution ensures your applications are always ready to handle dynamic workloads. Explore additional features like monitoring and scaling policies to optimize your deployment further.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *