![](http://www.msserverpro.com/wp-content/uploads/2017/05/azure.png)
Deploy and Configure VM Scale Sets (VMSS) in the Azure Portal
In the previous article, we have configured an availability set with Azure Load balancer where we configured everything manually for Availability Set. In this article, we are deploying and configuring VM Scale Sets which use Auto scale based on predefined metrics. Adding and removing VMs automatically based on predefined metrics. You control what metrics to monitor, such as CPU or disk, how long the application load must meet a given threshold, and how many VM instances to add to the scale set. Apart from this, you do not have to manually configure Azure Load Balancer; VMSS automatically create and integrate with Azure Load Balancer or Application Gateway and automatic distribution of VMs instances across Availability Sets or Availability Zones. According to Microsoft definition, “Azure virtual machine scale sets let you create and manage a group of identical, load balanced VMs. The number of VM instances can automatically increase or decrease in response to demand or a defined schedule. Scale sets provide high availability to your applications, and allow you to centrally manage, configure, and update a large number of VMs. With virtual machine scale sets, you can build large-scale services for areas such as compute, big data, and container workloads.”
- Easy to create and manage multiple VMs
- Provides high availability and application resiliency
- Allows your application to automatically scale as resource demand changes
- Works at large-scale
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-23-2019-10-08-43-PM.jpg)
Use the following steps to deploy and configure VM Scale Sets (VMSS) in the Azure Portal:
1. In the Azure Portal, click on + Create a resource. In the New search box type scale set and then choose Virtual machine scale set.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-06-18-AM.jpg)
2. On the Virtual machine scale set page, click on Create button.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-07-11-AM.jpg)
3. On the Create virtual machine scale set page, provide the following values:
BASICS
Virtual machine scale set name: MSSERVERPROVMSS
Operating system disk image: Windows Server 2016 Datacenter
Resource group: MSSERVERPRO-ASA-RG01
Location: Southeast Asia
Username: ktmadmin
INSTANCES
Instance count: 2
Instance size: Standard DS1 v2
Deploy as low priority: Yes
Use managed disks: Yes
AUTOSCALE
Autoscale: Enabled
Minimum number of VMs: 2
Maximum number of VMs: 5
Scale Out
CPU threshold: 75
Number of VMs to increase by: 1
Scale in
CPU threshold: 25
Number of VMs to decrease by: 1
NETWORKING
Choose Load balancing options: Load balancer
Public IP address name: MSSERVERPRO-LB-PIP
Domain name label: msserveprolb
CONFIGURE VIRTUAL NETWORKS
Virtual network: MSSERVERPRO-ASA-VN01
Subnet: FrontEnd-Subnet (10.1.4.0/24)
Public IP address per Instance: Off
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-10-57-AM-1024x493.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-12-39-AM-1024x277.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-15-01-AM-1024x368.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-27-49-AM-1024x650.jpg)
To confirm the scale set options, click on Create button.
4. VMSS … Your deployment is underway……
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-32-43-AM-1024x688.jpg)
5. After couple of minutes, VMSS…. Your deployment is complete ……
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-33-34-AM-1024x686.jpg)
6. On the Notifications, click on Go to resource.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-35-12-AM.jpg)
7. On the Virtual machine scale set Overview page, verify Public IP address and Autoscaling status is On.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-37-32-AM-1024x688.jpg)
8. Verify that previously configured auto scaling Instance limits and Scale Rules. You can also modify the existing rules later.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-54-39-AM-1024x689.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-24-2019-1-13-24-PM-1024x649.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-24-2019-1-20-49-PM-1024x650.jpg)
9. Go to Load balancer Overview page, copy the Public IP address.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-43-08-AM-1-1024x685.jpg)
10. On the Load balancer page, expand settings, click on Frontend IP configuration, and note down LoadbalancerFrontEnd IP address.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-44-06-AM-1024x683.jpg)
11. On the Backend pools, 2 virtual machines instances are running…because we select 2 Instance count during creating virtual machine scale set configuration.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-44-35-AM-1024x688.jpg)
12. Verify Health probes.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-45-13-AM-1024x686.jpg)
13. Verify that Load balancer rules has created.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-45-53-AM-1024x686.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-46-21-AM.jpg)
Connect to a VM in the scale set:
When you create a scale set in the portal, a load balancer is created. Network Address Translation (NAT) rules are used to distribute traffic to the scale set instances for remote connectivity such as RDP or SSH.
To view these NAT rules and connection information for your scale set instances:
1..From the list of resources, select your Load balancer, such as MSSERVERPROVMSSlb. Choose Inbound NAT rules to view NAT rules and connection information of scale set instances.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-46-54-AM-1-1024x686.jpg)
You can connect to each VM in the scale set using these NAT rules. Each VM instance lists a destination IP address and TCP port value. For example, if the destination IP address is 40.65.173.201and the TCP port is 50000, you connect to the VM instance as follows:
For a Windows scale set, connect to the VM instances using RDP use IP address appended with TCP port.
- For instance 1 connect to RDP, use 40.65.173.201:50000
- For instance 2 connect to RDP, use 40.65.173.201:50001
For a Linux scale set, connect to the VM instance with SSH on ssh
- azureuser@40.65.173.201 –p 50000
When prompted, enter the credentials you specified from the previous step when you created the scale set. The scale set instances are regular VMs that you can interact with as normal.
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-49-42-AM-1024x691.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-21-2019-7-53-01-AM-1024x685.jpg)
![](http://www.msserverpro.com/wp-content/uploads/2019/02/2-24-2019-10-18-11-PM-1-1024x531.jpg)
Summary:
I hope this article helps in deploying VM Scale Set (VMSS). VMSS allows you to deploy and manage a set of identical, auto-scaling virtual machines. You can scale the number of VMs in the scale set manually, or define rule to autoscale based on resource usage like CPU, memory demand, or network traffic. During VMSS deployment, Azure Load balancer is created automatically and Azure Auto scaling is added with a virtual network and a public IP address. Virtual machines in the scale set are not allowed with public IP address.
Sir, Can you create scale set with application gateway. I want to create auto scaled scaleset with application gateway. Can you create a tutorial.
Also, Is it possible to get azure cloud subscription in Nepal?
I could not create NAT rules for VM Scaleset from Azure Portal. The target VM option is not visible when new NAT rule is created for a VM instance in VMSS.
So I created through powershell and I could see it in Azure Resource Explorer, however not visible in Azure portal.
Also unable to remote connect VM instance using the public load balacer’s public ip address.
What am I missing?
Ola,
How to set the memory-based automatic scaling rule in Azure VMSS ?
How Can I Create an aplication with redundancy in scale sets if one instance is not working
other instance start working with load balancer? in linux and windows ?