DEV Community

Cover image for CREATING AND CONNECTING TO A LINUX VIRTUAL MACHINE SCALE SET
Seyi Lufadeju
Seyi Lufadeju

Posted on

CREATING AND CONNECTING TO A LINUX VIRTUAL MACHINE SCALE SET

OVERVIEW

You may deploy and manage a group of identical, auto-scaling virtual machines (VMs) with Microsoft Azure's Virtual Machine Scale Set (VMSS) resource. It keeps high availability while enabling you to simply scale in and out in response to demand. Applications that need to scale automatically to accommodate fluctuating workloads and have high availability are frequently implemented with VMSS. Because you only pay for the resources that are really used, it also aids in cost optimization.

This tutorial will show you how to create a Linux virtual machine scale set in Azure, set up the required parameters, and then connect to the virtual machines that are part of the scale set.

Prerequisites
Before you begin, make sure you have the following:

  • Azure Subscription: An active Azure subscription. If you don’t have one, you can create a free account here.
  • Basic understanding of Azure concepts, such as virtual machines, networking, and resource groups.

Steps to Create and Connect to a Linux Virtual Machine Scale Set
Step 1: Sign in to Azure Portal

Step 2: Create the Virtual Machine Scale Set
Search > Virtual Machine Scale Set Click Create.

Image description
On the Basics tab, provide the following details:

  • Subscription: Select your subscription.
  • Resource Group: Select the resource group
  • Name: Enter a name for the scale set.
  • Region: Select the same region as your resource group.
  • Availability Zones: You can choose to enable this for high availability, or leave it as default (no zones).

Image description
Under Orchestration and Scaling, select the following details

Image description

Under the Scaling configuration blade, select configuration

Image description

Edit Scaling conditions by clicking the pencil icon or add a new Scaling conditions by clicking the + icon
Image description
Add a scaling condition

  • set condition name
  • set scale mode
  • default instance count
  • Instance limit _ Minimum
  • Instance limit _ Maximum

  • Scale Out Condition

  • Scale In Condition

Image description

Image description
Configure Scaling policy

Image description

Under the Instance details, configure the details
Image description

Under the Administrator account set the details

Image description

Click Next through the other tabs (Spot,Disks, etc.), leaving the defaults unless you need specific configurations.
On the Networking tab set the following:

Image description
On the network interface click the pencil icon to edit, after edit click ok
Image description

Image description

Image description

On the Load balancing option

  • select Azure load balancer
  • select existing load balancer or create new

Image description
Image description

Image description

Review, create and download the ssh file

Image description

From the deployment successful page click resource
Image description

locate Instance blade to see how many virtual machine you have running based on your selection
Image description

Under Networking blade select load balancer
Image description
Under the Settings blade click on Inbound NAT rules, note the IP address and port for connecting to your linux machine through the command prompt or powershell
Image description

connect to your virtual machine using the code: ssh -i "input the path to the downloaded ssh file" azureuser@(your noted IP address) -p 50000

Image description
Image description

CONCLUSION
VMSS is an effective way to ensure that your application can handle increased loads by automatically scaling out and managing multiple VMs. By leveraging VMSS, you ensure high availability, fault tolerance, and simplified management of your infrastructure.

Moreover, the built-in load balancer and automatic scaling features make VMSS an essential tool for building scalable applications in the cloud.

Top comments (0)