DEV Community

Okechukwu Udensi
Okechukwu Udensi

Posted on

Creating a Virtual Machine Scale Set (VMSS)

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

Step 2. Search and select VMSS
Image description
Click on Create located at the top left of the Tab

Image description

Step 3. Configure/set-up the VMSS

Image description
Select your Azure subscription, select existing or new Resource group, type your VMSS name, select region and availability zone

Image description
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

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

Click Next: Networking:
Image description

Image description

Here you create Azure load balancer, thus:
Image description
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

Image description
Image description

Step 4. Go to Resource Group

Image description

Image description
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

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

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

Image description
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

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

Image description

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

Image description

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
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.

Top comments (0)