DEV Community

Cover image for Creating and Connecting to a Linux Virtual Machine Scale Set (VMSS)
OLALEKAN john Ayansola
OLALEKAN john Ayansola

Posted on

Creating and Connecting to a Linux Virtual Machine Scale Set (VMSS)

INTRODUCTION

Virtual Machine Scale Sets (VMSS) in Azure offer an efficient and scalable way to manage multiple virtual machines (VMs). Whether you're deploying a web application, containerized services, or handling data processing workloads, VMSS provides auto-scaling, load balancing, and high availability.

Overview of Virtual Machine Scale Set
Azure Virtual Machine Scale Sets (VMSS) are a powerful feature in Microsoft Azure that enables you to manage and scale a group of identical virtual machines (VMs) in a consistent and automated way. VMSS is designed to handle large-scale applications, workloads, or services, providing high availability, performance, and resilience.

VMSS automatically scales the number of VMs in response to demand, ensuring that you only pay for the resources you need, while maintaining the performance and availability of your applications.
In this blog, I will guide you through on how to create and connect to a Linux Virtual Machine Scale Set.
Steps in Creating Virtual Machine Scale Set

  • Step 1: Sign in to azure portal.com
  • Step2: Create Virtual Machine Scale Set
    portal

  • Click on create Virtual machine scale set

create vmss

  • Create subscription for the virtual scale set

subscription

  • Create the Virtual Machine scale set Resource Group

resource group

  • Create virtual machine scale set name

virtual scale set

  • Select the Region for the deployment for the Virtual machine scale set

region

  • Select Availability zone

availability zone

  • Select orchestration mode

orchestration mode

  • Select the security type

security

  • Set scaling mode to autoscaling and click configure

configuration

  • On scaling configuration page click on pencil to edit scaling condition

scaling

  • Make the changes according to choice of the virtual machine scale set you want

scale set

scaling set

scaling mode

  • Click save and make sure all the changes reflect on the configuration page

configuration

  • On scale in policy choose the virtual mass to be deleted first according to your preference

delete

  • Click on apply force delete and save

force

  • Select image of your choice

image choice

  • Select the size of choice and leave VM architectural at default

Architectural

  • At Administrative account Select SSH public key and set username of your choice

public key

  • Select generate new key pair and choose pair name or leave it at default

generate pair key

Network interface

  • Click on the pencil at network interface to edit

edit network interface

  • At network interface page Allow selected port to run ssh and Http and make sure you enable the public IP Address

run ssh

  • Allow load balancing and create load balancer if there is none before

allow load balancing

load balancing

  • Give name to the load balancer and create

name the balancer

  • Review

review

  • Create after the validation pass

create

  • Click on download key during deployment

download deployment

download

  • Click on go to resource
    resource

  • Search for network blade on the VM overview page and locate load balancing, click on it

load balancing

  • Locate and click on view inbound NAT Rules
    Inbound NAT Rules

  • Then run command promt with this frontend ip address

command prompt

  • Run Command prompt within administaror ssh -i pemkey username@fronted ip -p fronted port ( ssh -i â€ĒC:\Users\USER\Downloads\G_key.pem azureuser@4.155.27.238 -p 50000)

pem key

  • Update and uprage the Vmss with the following command
    sudo apt-get -y update
    sudo apt gey -y upgrade

  • To be able to run on nginx
    sudo apt-get nginx

  • Copy the frontend IP address on new browser and enter to welcome to nginx

nginx

Conclusion
Azure Virtual Machine Scale Sets provide an efficient, scalable, and automated way to manage large groups of VMs, offering benefits such as auto-scaling, load balancing, high availability, and simplified management. VMSS is ideal for applications that require consistent, scalable infrastructure and can be leveraged for a variety of workloads, from web applications to high-performance computing tasks.

By using VMSS, businesses can optimize both the cost and performance of their Azure environments while ensuring their applications are always available and responsive to user demands.

Top comments (0)