Creating a Virtual Machine Scale Set (VMSS)
Published: 2024-06-27 17:44:40

**Table of Contents**
Introduction
Step 1. Login to Azure Portal

Introduction
Virtual Machine Scale sets (VMSS) is all about deploying multiple VMs, trying to manage them, scaling them (auto scaling and manual scaling). The purpose is to provide a high availability while you centrally manage large number of VMs. With the help of load balancers, resources and track loads are distributed among the VMs in such a way that no VM will be overloaded.

**Step 1. Login to Azure Portal**
Open a browser, type url: portal.azure.com
Fill in your registered username and password, then process your entries. A successful login lands into Azure portal where various tasks can be executed accordingly. Also make sure you have a subscription in Azure to enable the creation of VM.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6knivkzax5cqc5c5lwt.png)

**Step 2. Search and select VMSS**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0q6a6j5yi1vk93rujohw.jpg)
Click on Create located at the top left of the Tab

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldf7l9unq2sf41oc03hr.jpg)

**Step 3. Configure/set-up the VMSS**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i70vqbmob84kurn726wd.jpg)
Select your Azure subscription, select existing or new Resource group, type your VMSS name, select region and availability zone


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1yzhvmqn2o9zbp6a9so.jpg)
Select Orchestration mode (uniform), 
Select Security type (standard),
select Scaling mode (manually)
select Instance count (2 VMs to start with)
select Image (linux: ubuntu)
select VM architecture (x64)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lipiz6dypu37c16hc637.jpg)

select Size from the dropdown field
select Authentication type: SSH public key
Type in Username, then key pair name appears automatically
Click Next: Spot Tab
Note: Spot Tab enables you to set the VM on discount basis which is not favorable in the long run. You can choose to ignore Spot settings if you wish not to run on discounts.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oujzgd9uxsygek610fss.jpg)

Click Next: Networking:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pkjyff4bsxnpey3jv4gw.jpg)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1mr0y4t37gtav9d3ysu.jpg)

Here you create Azure load balancer, thus:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f180qor9xqw20a19b278.jpg)
Here your network name will automatically be created
In load balancing option: Select Azure Load balancer
Select an existing Load balancer (if any) or click to create a new load balancer. In creating a new load balancer, there is a field to type in the name of your load balancer. You can choose to leave other fields on default, click on create button.
This will create a new Load Balancer name which shall be attached automatically.
Proceed to Review and create. Allow to pass validation then click on Create Button.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tbmnusiw2vy88ivwxobt.jpg)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqlzt6gdoa0duewdm18w.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34rkymc6783vmbfqfeml.jpg)

**Step 4. Go to Resource Group**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yd6am242u5xc2tdll0z3.jpg)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16xnbet0it81jhxk6w4y.jpg)
Here you see all the properties of this VMSS created.

To see the created instances (Virtual Machines).
Locate and click on Instance by the lefthand side of the VMSS panel.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xy1xlw161p7t94whykmy.jpg)


 **Step 5. Run Command Prompt lines**

Here you type in "command prompt" in the search field of your task bar, select run as administrator.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e74nz32eq9yk93mkxn1p.jpg)

To copy private key file path, open the download folder, click on the file once to select the file, click inside the address bar and copy the highlighted folder path (eg. C:\Users\dell\Downloads)


Combine and type these 3 things inside the command prompt:
1. ssh -i
2. C:\Users\dell\Downloads\DezxLVM_key.pem
3. DenzAzure@4.233.65.67 (this is your Linux VM username@Ip address)
4. -p 50000 (note: this is your inbound nat rule)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozmqc7dxjjhrfza3ndq5.jpg)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cp9hga6sltl5x9xdur4.jpg)
ssh -i C:\Users\dell\Downloads\De_key.pem DenzAzure@4.233.65.67 -p 50000

Hit enter button on your keyboard and type yes to process further.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqmi3b0tu7zsrgloj064.jpg)

type in: sudo apt-get -y update 
Hit enter key to process further
DezAzure@DezxLVM:~$ sudo apt-get -y update


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm2hwdj0jaq79emwbj25.jpg)

type in: sudo apt-get -y install nginx 
Hit enter key to process further

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4yshk4gcz7ws6fq6i4v.jpg)

**Step 6. Run IP address on browser**
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cyxushcy336ds8niwrql.jpg)
**Step 7. Stress your CPU**
Stress your CPU by running a command line to install stress:
sudo apt-get install stress-ng
Then login to check your instances percentage CPU.