What is a Virtual machine Scale Set?
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:
Azure Subscription: An active Azure subscription. If you don’t have one, create a free account here.
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
Open the Azure portal at portal.azure.com.
Log in using your Azure credentials
Step 2: Create the Linux Virtual Machine Scale Set
- In the search bar, type VMSS and select it.
- Click +Create
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.
Region: Choose East US from the dropdown.
Name: Enter a name for your scale set(CloudOpsVMSSRg).
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.
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
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
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 click Next: Disk> to continue
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.
Top comments (0)