[MUSIC]
>> Azure load balancer in
Azure Stack is a layer for a load balancer that
distributes incoming traffic among
healthy virtual machine instances.
Load balancers use the hash-based distribution algorithm.
By default, it uses a five-tuple hash of source IP, source port,
destination IP, destination port and
protocol type to map traffic to available servers.
Load balancers can either be internet facing,
where it's accessible via public IP addresses or internal,
where it's only accessible from a virtual network.
As our load balancers also support NAT or
network address translation to route traffic
between public and private IP addresses.
You can configure load balancer to load
balance incoming traffic across your virtual machines
and or forward traffic to and from
a specific virtual machine using NAT rules.
Before we begin this demonstration,
I want to show you a little bit of
setup that I did in this environment.
So first of all, I created some virtual machines.
So we'll show you what we have here.
I'm showing this to make sense of when we
go into load balancers configuration,
you'll see some things and this setup helps to clarify that.
So you see I have four virtual machines in here.
But they are configured just a little bit
differently with regards to availability sets.
So I made one availability set called SVRAvailSet.
Notice, when we started,
we had four virtual machines which exist in my Azure Stack,
but only three of them are in the availability set.
So SVR01, 02 and 03 are in the availability set,
but why the App01 server
and click on availability set for this fourth server,
there are no availability sets associated with that.
So keep that in mind as we create
a load balancer and you will see why that matters.
Now to create anything inside the Azure Stack portal,
there's a couple different ways to find these things.
The search bar at the top is really quick and simple,
and easy to use.
So you just start typing load balancer,
handling to you see that we can get to it this
way. That's one method.
You can also click
the "New" button and when you go to the New button,
you could scroll through everything we see it
right here or we can even get
you know categorically specific and click on networking,
and also we see load balancing there as well.
But you notice by default because I
haven't changed the original menu here,
on the left-hand side,
we do not see it.
So I like to have things in my menu.
So a way to do that,
is to click "More Services" and as I scroll down
in the networking I see
load balancers and I want to add that to my menu.
Notice, that the star is not highlight in yellow we
are down here below we see
Monitor which we also see on the left-hand side,
does have the star in yellow.
So therefore it shows in the menu.
So I want to do that also for load balancers.
I click the "Yellow star" and
it appears magically in the left-hand side.
If I want to group my Azure resources,
I can simply drag and drop that wherever I want.
So now that I have that conveniently in my menu,
let's create a load balancer.
I already have one created just for an example,
but we'll create one from scratch.
First of all, just like any Azure resource,
we want to give it a name and I like to keep
consistent names with the way I do my objects,
and there's lots of different ways to do naming conventions,
but I'll just follow the example that I did in the first one.
So since I called the first one ALB for Azure Load Balancer one,
I'll call this ALB2.
Notice, we have two types that give some information here,
so we can have
internal load balancer or an external load balancer.
The external one having a public IP address,
an example of that would be having
front end web servers that are going to
communicate with the internet directly.
If I was going to have an internal one,
that may be a back-end type server maybe
before the web servers in the configuration,
so maybe it's a mid tier or back-end database tier.
That would be an example of an internal one.
To keep it simple, I'll just select internal.
You have to select a virtual network,
so I had created a virtual network by default called VNetHub.
That VNetHub virtual network has three subnets in it.
All four of the servers that I showed at
the beginning are all in the subnet three.
So I have to select subnet three.
If I would select subnet 01 or 02,
in this demonstration I have nothing in it,
so I could not configure this.
So I need to select the subnet where the servers exist.
Notice, on the IP address assignment,
we can have it static or dynamic.
If I use dynamic,
Azure will automatically configure
the addresses or if I click static,
I can put my own private IP address in there.
But we'll just use dynamic.
If I have multiple subscriptions,
it would show in there, I just have the one,
so I just see the Mark Trial.
For the resource group,
I can create a new one or as I like to do,
is to keep them in general categories.
So I usually make
a resource group for all my network items in Azure.
Location by default in
Azure Stack currently we only have one region.
Eventually, later in the future we will have more than one.
But I'll just select the default one,
and then I can click "Create".
So it's pretty quick to deploy this
and you see here in the summary it has the resource group,
the location and the subscription.
You can also in these views,
you can change what columns are going to be displayed,
which is useful in the load balancer for example,
because we could take a look at the back-end pools,
the health probes, IP address, the kind.
So we can have load balancer type,
load balancing rules, NAT rules, all stuff,
so that when we're looking in that window it helps
to organize and classify what they are.
So I saw that the information said it was ready,
but I just simply need to click
"Refresh" and there it is, the second one.
So I'll click on this to configure it now.
Again, in the summary, tells me what Resource Group it's in,
all that survey information.
The activity log which is consistent with our Azure resources,
both in Azure Stack and Azure.
We can see here that we just
now were successfully configured writing a load balancer,
in the access control,
identity and access management.
Again, by default, all Azure resources,
the subscription owner will be the default owner for this.
We can also add additional roles if we want for owner contributor,
or reader are back roles.
Like all Azure resources, we have tags.
Since I've done this in
the other demonstration for network security groups,
we see I have the environment tag and I had
created a value for production if I
wanted to maybe add a different value,
I could do that as well.
So we'll call this DEV
in this case just to make it a little bit different.
Then, now we have
the Frontend IP configuration in the settings,
and that's simply has the IP address in here.
At this point, so for
the Frontend this is pretty much what we selected.
You see the Subnet03 but we
could come in here and change it after the fact.
Likewise, change the dynamic or
static and here we see when we did dynamic,
that's the IP address that it was assigned to it.
So we can change those initial settings
we did for the frontend IP configuration.
Now this is where it's interesting what the backend pools,
since I had an availability set with the three servers in it,
but the app server was not in it.
So let's see how that affects this option.
So for the backend pool,
let's just give it a name and I'll call this ALBBEPool.
Notice, the IP version is IP version four, in this case,
and in Azure Stack,
that is the only supported option
right now but it may change in the future.
Associated to, so if we have multiple VMs,
we can associate it in an availability
set or a single standalone VM.
So here's where it gets interesting.
If I select Single Virtual Machine,
all four of those Virtual Machines were in
the same Subnet as this
which is really important in order to be able to see them.
However, when I look at the target Virtual Machine,
and there, it tells you that as well.
VMs must be in the same location as the load balancers.
Basic VMs cannot be used with
the backend pools for internal load balancers,
only VMs that are in
the same Virtual Network as the load balancer will be listed.
Again, all four of my servers were
listed in there but since we're doing a single one,
we only see APP01,
and the reason why is because this is
the only one that was not an availability set.
Now as a best practice or we say current recommended practice,
when we do load balancing,
we'd like to have an availability sets.
Recently in Azure Stack,
they added the ability to have
availability sets so that if you had three servers,
for example in a web server configuration
and there was going to be an update in the Azure Stack,
you don't want all three of them to be shut down at the same time.
So by putting them in an availability set,
it ensures that they are put in three separate fault domains.
So when there's an update that's going
on in the Azure Stack deployment,
each one will be separating.
We can have three fault domains by default which is nice.
So now let's change this instead of single Virtual Machine,
I'll say availability set
and now we see something different since I had server one,
two and three, it recognizes that.
So it sees the SVRAvailSet,
and I can just select that,
and then all three will automatically be load balanced.
So again, as a current recommended practice,
when we do load balancing we
likewise want to have them an availability set.
A very important note also about an availability set,
you can't create one after you've made a Virtual Machine.
So you have to do
availability sets when you're making your Virtual Machines.
So that's how I did it.
In this configuration, when I built the first server,
I created an availability set
it was an option in the configuration,
then when I made Server two and three,
I simply added them to that existing availability set.
So that's the way you want to do that, okay?
All right. Then we can add a target network IP configuration.
I have to select one target once.
So I'll pick the first one.
Okay, and then I click "OK".
So now it's saving the load balancer backend pool,
and then the other things that we can configure on
here are health probes and add these in as well.
In the health probe configuration, you can give it a name,
select protocol HTTP or TCP.
Notice, HTTPS is not supported.
You select the port,
the interval and the unhealthy threshold which is the number of
consecutive probe failures that must occur before
a Virtual Machine is considered
unhealthy and notice the default is two.
Then we have load balancing rules.
So in the load balancing rules, again,
you give it a name, you select the frontend IP address,
select the protocol port.
But in this case,
I cannot do anything because I had to create a probe first.
Another prerequisite forward is to have the back-end servers.
We did have that, but I would have to create a probe,
and then these will be able to be configured for the port,
the backend pool, at the back-end pool to
health probe to assess and persistence,
and the idle time out.
Then we also have inbound NAT rules,
which we can configure.
With the inbound NAT rules,
again, you give it a name,
select the frontend IP address,
it's only IP version four in the service.
So you can select
what type of traffic you want to allow it to come through here,
things like for example MySQL,
HTTPS, LDAP, etc.
I'll just pick one of these as an example of like HTTP.
Then the port and the protocol and where it's associated to,
and also the target machine.
Again, because we tied this to the availability set,
I only see the three machines behind
the availability set and not the app server that was not.
I need to give it a name, so we'll just say NATRule as an example.
Finally, on the properties,
it just gives a summary again of
the resource ID which is useful for scripting,
the summary of the resource group and subscription and the ID,
and then also like in all Azure resources,
we can add locks for do not delete or read-only.
There you have it. That's how you create
an Azure Load Balancer in Azure Stack.
[MUSIC]