A Virtual Machine Scale Set (VMSS) is a service in Microsoft Azure that lets you create and manage many virtual machines that are all the same. It helps your application handle more users by automatically adding or removing virtual machines based on how much work there is.
This guide will show you how to create a virtual machine using windows 10 as the operating system, Create an Azure Compute Gallery independently to store and manage shared virtual machine images, publish the image to Azure Compute Gallery, and deploy it in a scalable virtual machine scale set to handle increased user demand.
Creating a virtual machine using windows 10 as an operating system. Steps:
1.Login to your Azure portal. https://portal.azure.com/
2.In the search bar, type Virtual Machine and select the option that appears grayed out.
3.Select + Create.
4.Select virtual machine.
5.On the Basic tab, under Project details, select your Subscription and select an existing Resource group or create a new one.
6.Still on the Basics tab, under Instance details, enter your Virtual Machine name, select the Region, Availability options, Zone options, Availability zone, Security type, Image, VM Architecture, decide if you want to use the Azure Spot discount, and choose the VM size.
7.On the Basics, under Administrator account, create an** Admin username** and password.
8.Choose and select the Inbound port rules. check the licensing box.
9.Select Review + Create.
10.Wait for validation pass, select Create.
11.Wait for the deployment to complete and Go to resource.
To manage your resources on the go, you can add them to your mobile device by scanning the QR code in the Azure portal.
1.On the resources, select open in mobile.
2.Scan the QR code or use the link on your mobile device.
3.After scanning the QR code on your phone, tap the link it will open the Google Play Store for Android or the Apple App Store for iPhone.
4.Select download and install in Google play store/Apple store.
5.After installation, select Open.
6.The link will open the Azure app you downloaded, click sign in.
7.Fill in your Login details, click next to sign in.
We need to capture an image of the virtual machine before creating a Virtual Machine Scale Set (VMSS). This image includes the operating system and settings of the virtual machine we want to scale. Since virtual machine scale set creates multiple copies of a virtual machine, we use this image to make sure each copy is exactly the same. We save the image in the Azure Compute Gallery, which acts as a central place to store and manage images. You can also create the Compute Gallery while capturing the image or do it separately. In this guide, we will create the Compute Gallery first before capturing the image.
Creating a compute gallery. Steps:
1.In the search bar, type Azure compute galleries and select the option that appears grayed out.
2.Select + Create.
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 that we have created the Compute Gallery to store our image, we can go ahead and capture the image from the virtual machine and save it in the gallery.
Capturing 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, take the default subscription and choose your resource group.
3.Under the instance details, the region is selected by default already.
4.Under Gallery details, select the Compute Gallery we already created. You will see two options for the operating system state: Generalized and Specialized. For this guide, we will choose Specialized. Also choose your target VM image definition or create a new one.
Generalized: When you create a virtual machine from this image, you will need to set up things like the computer name, admin username, and password the first time it starts.
Specialized: virtual machines created from this image are already fully set up, so you do not need to enter a name, username, or password, they are ready to use right away.
This is how you create 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 add more regions to make your image available in different locations. This improves availability, but it also increases the cost.
8.Select Review + create.
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 is important to know that an image is used to create both virtual machines and virtual machine scale sets.
An image is what you use to create both single virtual machines and groups of virtual machines in a scale set.
Creating a Virtual machine scale set (VMSS).
1.In the Azure portal, open the image you created. On the overview page, click + Create VMSS to start making a Virtual Machine Scale Set.
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 and your region.
4.Under Orchestration, pick the orchestration mode. There are two options: Flexible and Uniform. For this guide, we will choose Flexible.
Flexible is best when you need high availability for lots of virtual machines.
Uniform is good for simple, stateless systems where all virtual machines are the same.
5.Under Scaling, you can choose Manual or Autoscaling. Autoscaling lets the system add more virtual machines when CPU usage is high (like during heavy traffic) and remove virtual machines when it's low. But for this guide, we will use Manual scaling. We will set the Instance count to 1 for now and increase it manually later if needed.
6.Under the Instance details, choose the Image (the one we created initially) and size.
Under Administrator account, you will see that the username and password fields are grayed out. That it because we chose the Specialized operating system, which already has this information set up.
7.Select Review + Create.
8.When the validation is passed, Select Create.
9.Wait for the deployment to complete and select Go to resource
10.In the left hand menu under Resources, type Scaling in the search bar. Then under Availability + Scale, click on Scaling to manage how your virtual machine scale set scales.
11.To manually scale up the instance count, select manual scale, increase to 2 and save.
12.Go to your virtual machine and confirm it creating other 2 virtual machines.
Top comments (0)