A Virtual Machine Scale Set (VMSS) is an Azure compute resource that lets you deploy and manage a group of identical, load-balanced virtual machines that can automatically scale in or out based on demand. Instead of manually creating and managing multiple VMs for your application, you create one VM template, and Azure automatically clones, monitors, and scales it for you. They are collection of identical virtual machines that are automatically managed or scaled together. We have got Horizontal scaling which is scaling out and scaling in, in other words increasing and decreasing of your virtual machines and vertical scaling is scaling up and down, increasing and decreasing the CPU,RAM etc.
To create a virtual machine scale set, in this article we need to create a virtual machine, using window server as the operating system, create a compute gallery as a standalone, capture the image, and store the image in the compute gallery.
To create a virtual machine using window server as an operating system. Steps
1.Login to your Azure portal. https://portal.azure.com/
2.In the search resources, search for virtual machine, and select the grayed virtual machine
3.Select + Create
4.Select the virtual machine
5.On the Basic, under Project details, choose your Subscription and your Resource group or create new resource group.
6.Still on the Basics,under the Instance details choose your Virtual machine name, Region, Availability options, Zone options, Availability zone, Security type, Image, VM Architecture, choose whether to Run with azure spot discount and the size.
7.On the Basics, under Administrator account, select Password, choose your Admin user name and password.
8.Choose and select the Inbound port rules
9.Select Review + Create and wait for validation pass.
10.when the validation is passed, select Create
11.Wait for the deployment to complete and Go to resource
To manage and to get instance access to the resources you created in your Azure portal, you can add it to your mobile devices using the QR code.
1.On the resources, select open in mobile
2.Scan the QR code or use the link on your mobile device
3.On your mobile device, after scanning the QR code, select the link, it will take you to Google play for android phones and Apple store for iPhone users.
4.Select download and install in Google play store/Apple store.
5.After installation, select Open
6.It will take you to the downloaded Azure App, you will be asked to log in, select login
7.Fill in your Login details
8.Sign in
Before creating the virtual machine scale set, we have to capture the image, and save it in the Azure compute gallery. Image consists of the operating system and properties of the virtual machine we are to scale out, which will be used as the OS while deploying the VMSS. Like we discuss earlier that VMSS is the multiple creation of a virtual machine, so to do that we need to replicate the exact the properties of the virtual machine we want to scale and save it in a central repository which is the Compute gallery. N/B you can create compute gallery while capturing the image and we can also do that as standalone. but in this article, we are going to create the compute gallery as a standalone before capture the image.
To create Azure compute gallery.
1.In your search recourses, search for Azure compute gallery and select.
2.Select + Create. N/B we have got two + create button, choose either of them.
3.On the basics,under project details, choose your subscription and resource group
4.On the Basics,under Instance details.choose the name and the region.
5.Select Review + Create
6.Select Create when the validation is passed.
7.Wait for the complete deployment.
Now we have created the compute gallery, where we can save our captured image, we can now capture the image and save it in the compute gallery.
To capture Image
1.Go to the virtual machine, on the overview page. Click on capture, and select image
2.On the basics, under the project details, choose your subscription and resource group. Though the subscription is already grayed out.
3.Under the instance details, the region is already grayed out.
4.Under Gallery details, choose or create a compute gallery but we have created one so we choose the compute gallery we have created. We have two Operating system state which is Generalized and Specialized. But for the purpose of the article, we are going to choose specialized.
Generalized: VMs created from this image require hostname, admin user, and other VM related setup to be completed on first boot, it requires admin username and password.
Specialized: VMs created from this image are completely configured and do not require parameters such as hostname and admin user/password.
Still under the Gallery details, create or choose a Target VM image definition.
5.Under Version details, choose your version number, end life of date.
6.Under Replication, choose your default storage sku, and default replica count.
7.You can also choose other regions, but the more your other region, the high the availability and the higher the cost.
8.Select Review + create and wait for validation pass.
9.select Create when it passed its validation
10.Wait for deployment to complete. N/B before the deployment of the image, the virtual machine will be deallocated first. And the deployment takes couple of minutes.
It's important to note that Image is used to create virtual machine and virtual machine scale set.
After the deployment of the image, we can now create the virtual machine scale set.
To create a Virtual machine scale set (VMSS)
1.In the Azure portal, go to the Image you created, on the overview page, select + create vmss
2.On the Basics, under the Project details, choose your subscription and resource group
3.Under scale set details, choose the virtual machine scale set name
4.Under Orchestration, choose the orchestration mode, we have got two types of orchestration mode Flexible and Uniform but we are going to choose flexible.
Flexible: when you want to achieve high availability at scale in a large number.
Uniform: when you want to work on stateless system.
5.Under Scaling, you can choose manual or autoscaling. Auto scaling is based on CPU metric or any schedule. You can instruct the virtual machine to scale out more virtual machine to reduce the intensity on the CPU because of high traffic or scale in when the CPU is not spinning in full functionality because of lesser traffic. In this article we are going to choose manual scaling. Also choose the Instance count, we are going to choose 1, then increase it manually.
5.Under the Instance details, choose the Image (the one we created initially) and size
Under Administrator account, note that the username and the password were all grayed out because we chose Specialized state of the operating system.
- Select Review + Create
7.When the validation is passed, Select Create
8.Wait for the deployment to complete and select Go to resource
9.On the resources, on the left side menu bar, search for scaling, under availability + scale
10.To manually scale up the instance count, select manual scale, increase to 20 and save.
11.Go to your virtual machine and confirm it creating other 20 virtual machines.
Top comments (0)