This is Part 11 of Azure tutorial. In our previous video, we discussed what is a
virtual machine scale set and why we need it. In this video, we'll discuss, how to create a
virtual machine scale set. As usual, in the azure portal, search for "virtual machine
scale set" or we can also search by its acronym "vmss" - which obviously stands for virtual
machine scale set. On this virtual machine scale set page, click "Add". First, Subscription and
then Resource group. Let's actually create a new resource group. I'm going to name it rg-testing.
A resource group as you know is a group of related azure resources. This grouping allows us to manage
all the resources that belong to a specific application and deployment environment as one
unit. We can even automate deployments using azure resource manager templates. We discussed resource
groups in detail in Part 5 of this video series. Next, a name for our virtual machine scale set.
The common convention is to use the prefix "vmss", which obviously stands for virtual machine scale
set, and we're going to use this scale set for a demo purpose. So, let's name it "vmss-demo".
Next, a region where we want our scale set to be created. At the moment, as you can see,
South India region is selected and if we scroll a bit down, notice Availability zones are not
available in this selected region, and if you're building a high availability system, then you may
want to select a region where availability zones are supported. I know East U.S region supports
availability zones. So, let's select that. Notice, as soon as East U.S region is selected,
availability zone is lightened up and in this specific region, we have three availability zones.
So, let's check all these check boxes, so our VMs in the scale set are distributed across these
three availability zones. Next, "Image", that is, the base operating system that you want on all
your virtual machines in the scale set. As you can see from the drop down list here, we have several
choices - Windows or Linux. I'm going to use "Windows 10 Pro" version. Azure spot instance.
This option is great for cost saving. Basically it allows us to use unused azure capacity
at a significantly low price. However, at any point in time, when azure needs the capacity back,
the spot VMs are evicted with just 30 seconds notice. Therefore, spot VMs are great for
workloads that can handle interruptions like batch processing jobs, development or test environments,
large compute workloads etc. Next, we need to select the size of a VM. Basically, it is the size
that determines the processing power, storage capacity and memory. So, based on the size that
we select and the operating system we have chosen, an hourly price is charged. I'm going to leave it
at the default that we have right here. Next, an administrator username and password. Basically,
we'll be using these credentials to log into our virtual machines in the scale set. It's
very important we remember these credentials, because in just a bit, we'll be using them to RDP,
that is "Remote Desktop Protocol" into virtual machine in our scale set. Finally,
check this "Licensing" checkbox and then click "Next" to configure the disks for our virtual
machine scale set. I'm going to leave the defaults that we have here and then click "Next" to
configure "Networking" options. We configure three things here - Virtual network, Network interface
and Load balancing. Virtual network or VNet as it is commonly called, allows virtual machines
in our scale set to securely communicate with each other, the internet and on-premises networks. It's
very similar to a traditional network that you see in your own on-premise data-center. Next, network
interface. Just like a physical machine that you have at your home, a virtual machine can also have
one or more network interface. It is this network interface that enables a virtual machine to
communicate with other virtual machines, internet and even on-premises servers. By default,
the virtual machines we create in azure are not accessible over the internet for obvious
security reasons. However, you can override this, by opening an inbound port. For example, let's say
we want to access the VM over the internet using RDP, that is remote desktop protocol. For this,
we need to open the RDP inbound port. If you don't have this port open, obviously you will not be
able to RDP into the virtual machines. So, let's click on this pencil icon. At the moment we are on
"Edit network interface" blade, and I'm going to leave all these defaults here. The only thing that
we're going to change is, "Public inbound ports". Let's select this check box, "Allow selected
ports", and remember we want to be able to RDP into the virtual machines in our scale set. So,
let's drop this list down and check this check box RDP(3389). So, basically with this configuration,
we are opening up this port 3389 for RDP communication, and one more important thing is, we
have to enable Public IP address. Without this, we will not be able to communicate with the virtual
machines in our scale set from the internet. So, let's enable this and then click "OK".
Finally, Load balancing. If you want, a load balancer to be created, check this checkbox
"Use a load balancer". This is going to automatically create a load balancer and
distribute the incoming traffic between all the virtual machines in our scale set. Let's leave
all the defaults that we have here and then go to the "Scaling" tab. This is where we specify
the number of VMs we want in our scale set. At the moment the instance count defaulted to 2,
but we can create up to 1000 VMs. If you remember, the azure region that we have selected, that is
the East U.S region has got three availability zones. So, let's actually create three VMs,
so each VM is placed into a separate availability zone. So, even if one of the availability zones
is down due to some reason, we still have the other two VMs available from the rest of the two
availability zones. In case, if we create six VMs, then each availability zone will have two
VMs. I'm going to leave the rest of the defaults here, and then "Review and Create" our scale set.
Validation passed. So, let's create our scale set.
As you can see from the message on the screen, deployment is in progress
. It's going to take few minutes to create this virtual machine scale set.
There we go. Our deployment is complete. So, let's click on our resource group rg-testing.
Notice, in addition to our virtual machine scale set itself, several other resources are also
created like the NSG - Network Security Group, public IP address, Virtual network, Load balancer
etc. Now, let's click on our virtual machine scale set - "vmss-demo". If you remember, we specified,
we want three VMs in our scale set, and to see those three VMs, click on "Instances".
There we go. We have all our 2 VMs up and running. Now, let's say we want to log into this VM. So,
let's click on it and then click on this "Connect" button. We want to connect using RDP.
So, let's select that. If you remember, for RDP communication, we have opened up
this public port 3389. So let's click on this button "Download RDP file". Click on it.
Provide the administrator username and password that we have specified
while creating our virtual machine scale
set. There we go. We are now remotely logged into our virtual machine
in azure. That's it in this video. Thank you for listening.