In this article, we will discuss how to create Microsoft Azure virtual machine scale sets. Virtual machine scale sets can be used to deploy and manage auto-scaling virtual machines. We will discuss the essential steps for creating a scale set from the Azure portal or the command line.
A virtual machine scale set
Like we mentioned earlier, a virtual machine scale set can deploy and manage a group of auto-scaling virtual machines. The VMs can be scaled either manually or by defining a set of rules. The latter option can scale based on resource usage, such as central processing unit (CPU), memory, or network traffic.
- It lets you create and manage a group of load-balanced virtual machines
- It automatically increases or decreases the number of virtual machines in demand of a defined schedule
- It provides high availability and application resiliency
- It can be used to work on large scale
Please note that a load balancer distributes the load to the available virtual machines in a scale set.
How to Create Microsoft Azure Virtual Machine Scale Sets?
We will now discuss the steps for creating a scale set in Azure. For performing the steps below, make sure your Azure subscription is active. You can create a free account from the Azure website. Now perform the following steps:
Login to Azure
The first step is to log in to azure using the following website link.
Create a load balancer
The objective of the load balancer is to distribute the load among the virtual machines in the scale set. You can create the load balancer using the following steps:
Open load balancer
In the portal, search for the load balancer and select it.
Provide the necessary information
Now, in the Basics tab of creating load balancer option, provide the following details:
- Subscription – Provide your subscription details
- Resource group – First, select Create new and then type myVMSSResourceGroup
- Name – myLoadBalancer
- Region – Provide any region such as ‘East US’
- Type – Select Public
- SKU – Select Standard
- Public IP address – Select Create new
- Public IP address name – myPip
- Assignment – Static
- Availability zone – Provide Zone-redundant
After providing the above information, select ‘Review + Create’. It will then perform validation, after which select ‘Create’.
The image above shows the snapshot where the above information is provided through the Azure portal.
Creating a virtual machine scale set
Now perform the following steps to create a virtual machine scale set:
- First of all, open the Azure portal
- In the portal, search for a virtual machine scale set.
- Select the virtual machine scale set option.
- Then on the virtual machine scale set page, choose the Create option. This will open the create virtual machine scale set page.
- Go to the Basics tab, and then under Project details, make sure you selected the correct subscription.
- Select myVMSSResourceGroup from the resource group list.
- Provide the name of the scale set as myScaleSet.
- Provide an appropriate region.
- For orchestration mode under Orchestration, select the option Uniform.
- Select market place image as ‘Ubuntu Server 18.04 LTS’.
- Enter the user name and then the authentication type you prefer.
- Navigate to the next page by choosing Select.
- For the disks page, leave the option to Default.
- You will then see the networking page. In the load balancing section, choose the ‘Use a Load balancer’ option in the load balancing section.
- Select Azure Load balancer in the load balancing options.
- Now, choose the ‘Create New’ option.
- Type ‘myBackendPool’ and then choose ‘Create’.
- Once done with all the steps above, select Create+Review.
- Once the validation step is completed, you can choose to Create to deploy the desired scale set.
The image above shows how you can create an Azure load balancer using the AWS portal.
Note: In the authentication, you can choose a password that must be 12 characters long. If you are using a Linux image, you can select a secure shell (SSH) public key.
Below you can see how to create a virtual machine scale set.
Creating a virtual machine scale set using the command line
Now, we will discuss the steps to creating a virtual machine scale set using the command line. You can use the bash environment in the Azure cloud shell. Alternatively, you can install the Azure command line interface (CLI). Now perform the following steps:
Create a resource group
First, create the Azure resource group using the following command:
Create a virtual machine scale set
Next, run the following command to create a virtual machine scale set:
This will take a few minutes. Using the above commands, you will be able to create and configure the resources and virtual machines (VM).
Tip: To use an existing SSH key, use the
In this article, we have discussed the basic steps for creating a virtual machine scale set. We discussed two approaches for making the scale set. You can use the Azure portal to create the scale set. Alternatively, you can also use the command line to achieve this.
More details about the process of how to create a virtual machine scale set and how to deploy it can be found on the Azure website.
If this guide helped you, please share it.