DEV Community

Cover image for How to create a virtual machine scale set (VMSS)
Ugonna
Ugonna

Posted on

How to create a virtual machine scale set (VMSS)

creation of virtual machine scale set is creation of a virtual machine and making multiple copies of that virtual machine. The importance of VMSS is if there is a large workload such as game that has peak and off-peak period. The VMSS will be able to scale in and scale out preventing the system from crashing.
For this exercise the virtual machine machine created in "https://dev.to/stippy4real/how-to-create-a-datadisk-in-a-virtual-machine-and-initialize-the-disk-and-make-it-usable-44i0" will be used.
Open the virtual machine ugovm
In ugovm to capture the image of the virtual machine you have to first create azure compute gallery which helps to save images captured.
In azure portal search for azure compute gallery and select it
Image description
Under azure compute gallery select +create
create compute gallery
In basic tab, in projects details select the resource group ugoRG
Image description
In instance details, name it ugocomputegallary, in region select (US) West Central US and in description "is where VM images will be stored". Then click review + create
Image description
When valiadation has passed click create
Image description
Go back to ugovm, on the dropdown under capture select image
Image description. selecting image is capture the entire state of the virtual machine.
Scrow down to gallery details, in Target Azure compute gallery
select ugocomputegallaries that was created earlier in this post. In Operating system state, select specialized. In Target VM image definition click create new, name it ugoimage and click ok
Image description
In version details, the version number give it 0.0.1. leave the rest as default then click review and create
Image description
After validation has passed, click create
Image description
The objective of VMSS is when traffic is too much, the vm scales out and when it reduces it scales in. The above process, is horizontal scaling.
After the deployment, go to resources
Image description
To test it, in the 0.0.1 (ugocomputegallaries/ugoimage/0.0.1) select + Create VM
Image description
In instance details, name the vm, vm41. in image showns the image captured image earlier (ugocomputegallaries/ugoimage/0.0.1 -x64 Gen2. The above illustration shows we have created an image that can be used for further deployment
Go to ugocomputegallaries/ugoimage/0.0.1, click on + Create
Image description
In scale set details, name the virtual machine scale set ugovmss
Image description
In Orchestration, in orchestration mode select flexible
Orchestration mode Choose how virtual machines are managed by the scale set. In flexible orchestration mode, you manually create and add a virtual machine of any configuration to the scale set. In uniform orchestration mode, you define a virtual machine model and Azure will generate identical instances based on that model.
Flexible achieve high availability at scale with identical or multiple virtual machine types while uniform is optimized for large scale stateless workloads.
In scaling, in scaling mode select Manually update the capacity: Maintain a fixed amount of instances.
Image description
Leave other things as default, then click review and create
Image description
After final validation has passed select create
Image description
After the deployment, go to the vmss created. In availability + scaling select scaling
Image description
In Choose how to scale your resource leave it at manual scale. In instance count type 70 and save
Image description
search virtual machine to see the 70 virtual machine created and running
Image description.

Top comments (0)