I am going to be writing about how to create a VMSS from a captured image using the Azure portal in this article.
First things first, what is VMSS? A Virtual Machine Scale Set (VMSS) is a collection of identical, managed virtual machines (VMs) that are created and managed together. VMSSes can be used to create scalable and reliable applications.
The first thing is to go to the Azure portal. This article is a follow-up to the previous one, where I captured the Windows VM Click here to read before doing this.
As shown in the diagram below, you click on Create VMSS after capturing the image.
In the Basics tab, under Project Details, I selected a valid and running subscription and then selected my existing resource group named Augustworkload-reggierg. I also gave the VMSS name Windowsscaleten in the same region, UK South.
under orchestration, I chose flexible, as shown in the diagram below
There are two orchestration modes in VMSS:
Uniform orchestration mode is optimized for stateless workloads with identical instances. In this mode, the scale set creates and manages a set of identical VMs. You cannot manage individual VMs in a uniform scale set.
Flexible orchestration mode is optimized for stateful workloads and workloads that require high availability. In this mode, the scale set creates and manages a set of VMs that can be different from each other. You can manage individual VMs on a flexible scale.
The main difference between the two modes is that uniform orchestration mode hides the individual VMs from you, while flexible orchestration mode exposes them. This means that in uniform orchestration mode, you can only manage the scale set as a whole, while in flexible orchestration mode, you can manage individual VMs.
In the context of VMSS, a stateful workload is one that maintains state between VM instances. This means that the state of the workload, such as data or configuration, is stored on the VM's disks. If a VM instance is replaced or fails, the state of the workload must be restored to the new VM instance.
A stateless workload, on the other hand, does not maintain state between VM instances. This means that the state of the workload is not stored on the VM's disks. If a VM instance is replaced or fails, the workload can be restarted on a new VM instance without any loss of state.
Here are some examples of stateful workloads:
Databases
File servers
Message queues
Distributed applications
Here are some examples of stateless workloads:
Web servers
Load balancers
Content delivery networks
Batch processing jobs
The type of workload you have will determine the best orchestration mode for you. If you have a stateful workload, then you should use flexible orchestration mode. This will ensure that the state of your workload is preserved if a VM instance is replaced or fails.
If you have a stateless workload, then you can use either uniform or flexible orchestration modes. Uniform orchestration mode is simpler to manage, but flexible orchestration mode gives you more control.
For size, I selected the minimum size available, as I am doing it for testing purposes.
Under the Administrator account, you will notice, as shown in the diagram below, that there is no need for a username and password because I chose a specialized VM when capturing the Windows VM image. As shown in the diagram below, and then I accepted the license agreement.
Go to the Disks tab I selected Standard SSD as this is good for development and testing purposes, but depending on your business needs, you might have to select something else.
Also Under the Disks tab, you will find the data disk I added to the VM I captured, as shown in the diagram below.
Select Next: Networking to move the networking configuration options
Select Next: Scaling to move to the scaling configurations shown in the diagram below.
A custom scaling policy allows you to control how your Virtual Machine Scale Set (VMSS) scales in and out. You can use these options to scale your VMSS based on a variety of factors, such as CPU usage, memory usage, or disk I/O.
Instance count is the number of instances in the scale set.
The minimum value for autoscale on this scale set is
The maximum value for autoscale on this scale set
The CPU usage percentage threshold for triggering the scale-out autoscale rule
Duration: This is the amount of time that the Autoscale engine will look back for metrics. For example, 10 minutes means that every time autoscale runs, it will query metrics for the past 10 minutes. This allows your metrics to stabilize and avoid reacting to transient spikes. The Storage queue Approximate Message Count and Service Bus Message Count metrics are special in that these metrics are point-in-time only and have no history. For these metrics, the duration field will be ignored by the Autoscale engine.
Number of instances to increase by: the number of virtual machine instances to add to the scale set when the scale out autoscale rule is triggered.
Number of instances to decrease by: The number of virtual machine instances to remove from the scale set when the scale in the autoscale rule is triggered.
Select Next: Management tab as shown in the diagram below.
All I am doing here is disabling diagnostics.
as shown in the diagram below.
Select Next: Health to move to the Health tab shown in the diagram below.
I skipped the Health tab and went to the next tab, which is Advanced, as shown in the diagram below.
Max spreading: The balance between fault domains of the VMs in the scale set is determined by the spreading algorithm. VMs are dispersed throughout each zone's fault domains with the maximum amount of spreading. VMs are always distributed evenly over exactly 5 failure domains when spreading is fixed. A scale set using "Max spreading" will still finish deployment if there are fewer than 5 fault domains available, while a scale set using "Fixed spreading" would not.
Select Next: Tags to move to the Tags tab shown in the diagram below.
In Azure, tags are metadata elements that you apply to your Azure resources. They're key-value pairs that help you identify resources based on settings that are relevant to your organization. For example, you could create a tag named "Environment" with the value "Production" to identify all of your production resources, as shown in the diagram below.
Then select Next Review+Create, and after validation is passed, you click on Create as indicated in the diagram below.
In the diagram below, you can see the overview page of the VMSS.
The diagram below shows the two VMs that are created in the VMSS
In the diagram below, you will find the data disk already attached to the first VM in the VMSS.
In the diagram below, you will find the data disk already attached to the second VM in the VMSS.
In the diagram below, you will find the data disk already attached to the VMSS itself.
To locate VMSS in the Azure portal you can type vmss in the search bar as indicated in the diagram below.
In the diagram below is the evidence of the disk drive with the same letter I gave when I attached the disk and created the VM, Click here to see how to add a data disk to my Windows VM.
Clean up resources
When no longer needed, delete the resource group, scale set, and all related resources. To do so, select the resource group for the scale set and then select Delete.