This is Part 10 of Azure Tutorial. In this video, we'll understand azure virtual machine scale sets.
These are commonly known by the acronym VMSS, which obviously stands for Virtual Machine Scale
Set (VMSS). So, what is a virtual machine scale set? Well, in short, a virtual machine scale set,
lets us easily create and manage multiple virtual machines. So, the obvious question that comes to
our mind at this point is, why do we ever need to create and manage multiple virtual machines? that
is, why do we need a virtual machine scale set? Well, let's understand this with a simple example.
Consider a typical 3-tier application. It's very common to have multiple web servers
in the web tier and multiple application servers in the business tier. In this specific example
though, we just have four web servers in the web tier and four application servers
in the business tier. In real world though, depending on the traffic and demand for your
application, you may have many many web servers and application servers in their respective tiers.
Now, consider Gmail.com for example. I think it has over a billion users worldwide.
To be able to handle and process all these user requests, I wouldn't be surprised if they have
thousands of web servers and business servers. Now, one important point to keep in mind is,
when we have many VMs that run our application, it's very important to maintain a consistent
configuration. Now, you might be wondering, why do we need to maintain a consistent configuration
across all these servers? Well, for reliable performance of the application. So, things like,
the VM size, disk configuration and any software that we install - including our application code
itself and its dependencies should match across all VMs. Now, imagine the amount of time and
effort it takes to create all these thousands of servers manually one at a time. It's not only time
consuming, monotonous and tedious, but also error prone. So, this is a perfect scenario for using
virtual machine scale set. So, again, what is a virtual machine scale set? Well, in simple terms,
a virtual machine scale set lets us easily create and manage multiple virtual machines. All
VMs in a scale set are identical, meaning they are created from the same base operating system image
and configuration. Obviously, this approach lets us easily manage hundreds of VMs without
any other additional configuration. For traffic distribution, an azure load balancer is also
deployed along with the virtual machines in a scale set. There's no need to manually create
the virtual machines or the load balancer. Just imagine the amount of time it saves us.
Even better, with the auto scale feature, the number of virtual machines can automatically
increase or decrease in response to demand. You can use metric based auto scaling. There are many
many metrics from many sources in Azure. For example, if the CPU utilization is over 70%,
increase the VM instance count by one. Not just scaling out, you can do the opposite as well,
that is auto scale-in when the demand subsides. For example, if the CPU utilization
falls below 20%, do the opposite, that is, decrease the VM instance count by one.
Now, we can also increase or decrease the number of VMs in a scale set, based on a defined
schedule. For example, let's say, next week, we are launching a new product or a business line.
So, starting next week, we're going to have a heavy peak, maybe for three days. For this, we can
define a set schedule. For example, at 9:00 AM on January 1st - 2021, increase the VM instance count
to 50 and at 9:00 PM on January 3rd, when our peak ends, bring the instance count back to our
baseline configuration. How cool is that? So, there are three ways to increase or decrease VMs
in a scale set. Manually, through the azure portal or many of the azure APIs that are available.
Auto-scale based on metrics or a defined schedule. If all of this, is a bit confusing at the moment,
please don't worry. In our next video, we'll create a virtual machine scale set
and see all these in action. That's it in this video. Thank you for listening.