Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure
in

Internal Load Balancer in Microsoft Azure

In the article, we will be seeing the concept of how to create an internal load balancer in Microsoft Azure in between two VM which are hosted in the same network. The reason behind the creation of a load balancer in the VM is to handle the huge number of requests which are given to a virtual machine when it becomes difficult for the VM to handle these.

1- Create Virtual Network (VNet)
2- Create Virtual Machine
3- Internal load balancer
4- Test load balancing

Once we create two different virtual machines in the same virtual network, proceed to create and configure the load balancer with its set of rules.

Internal Load Balancer in Microsoft Azure

Azure internal load balancer is used to manage & divert the requests from the clients to different virtual machines (VMs) which are discovered in the same network. When a virtual machine receives many requests from the client, there will be some conjunction happening in the VM. To control this conjunction, we can make use of the internal load balancer conception where the requests from the users will be reciprocally shared in between the two different virtual machines which are configured in the VNet. The appeal will be shared in between the VMs position on the configuration set by us when we design a load balancer.

Create virtual networks

1- Log in to the Azure portal

On the Azure portal, select Azure menu bar and then select Virtual Network.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- Click on create virtual network.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

3- Select your subscriptions, to create a resource group then click on create new.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

4- Type a recourse group name (rg-loadbalancer) and then click ok.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

5- Instance details type a virtual network name (myvnet) select regions (east US) and then click Next : IP Address >.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

6- IP Addresses tab, enter 10.0.0.0/8 for the IPv4 Address Space field. Click the + Add subnet button below.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

7- Add subnet wizard; enter a Subnet Name (mysubnet) and type 10.0.0.0/24 for Subnet Address range and then click Add.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

8- Select Review + Create.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

9- Select Create.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

10- Virtual network successfully created.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Create Virtual Machines

Create a VM in the virtual network so that we can communicate between them.

1st VM

1- Azure portal menu tab and then choose Virtual machines.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- Select the + Add button to create virtual machine.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

3- Resource group select (rg-loadbalancer).

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

4- Instance details

Enter a virtual machine name (myvm1)
Region select (East US)
Availability options select Availability set.
Availability set select to create new.
Type a name (myavailabilityset) and then click ok.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

5- Image select Windows Server 2019 Datacenter. You can choose a different operating system, but the remaining steps assume you selected Windows Server 2019 Datacenter.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

6- Administrator account

Enter a username (jamil), Password.
Public inbound ports choose to allow selected ports.
Select inbound ports (HTTP, HTTPS, RDP)
Click Next : Disks > and then click Next + Management >

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

7- Choose boot diagnostics (off) and then click Review + create.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

8- Select create.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Create the second VM

Complete steps 2-8 again, with the following changes.

NameValue
Resource grouprg-loadbalancer
Virtual machine namemyvm2
Region(US) West US
Availability optionsAvailability set
Availability setmyavailabilityset
ImageWindows Server 2019 Datacenter
Administrator accountusername password
Public inbound portallow selected ports
Select inbound portsHTTP, HTTPS, RDP
Managementboot diagnostics off
Create 

Create the third VM

Complete steps 2-8 again, with the following changes.

NameValue
Resource grouprg-loadbalancer
Virtual machine namemyvmtest
Region(US) West US
Availability optionsAvailability set
Availability setmyavailabilityset
ImageWindows Server 2019 Datacenter
Administrator accountusername password
Public inbound portallow selected ports
Select inbound portsHTTP, HTTPS, RDP
Managementboot diagnostics off
Create 

The VMs take a few minutes to complete. Now the VMs (myvm1, myvm2, myvmtest) successfully created.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Now we need to install Web Server IIS roles on VMs (myvm1, myvm2).

How to Install Web Server IIS.

Creating the load balancer

The next step after creating three different VMs in the same VNET is creating a new load balancer.

1- Select Azure menu bat and then select Load Balancers.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- Select the + Add button to create load balancer.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

3- Select resource group (rg-loadbalancer).

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

4- Project details

Enter the name of Load Balancer (webserverlb)
Region (East US)
Type Internal and SKU Basic.
Virtual network (myvnet)
IP address assignment (dynamic)
Select Review + create >.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

5- Click on Create.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

6- Now you can see load balancer successfully created, select your load balancers.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Backend Pools

1- Now click on Backend Pools and then click on + Add.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- Add backend pool wizard, Type a name
Virtual network (rg-loadbalancer)
Associate to select virtual machines and then click the add button under a virtual machine.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

3- Add virtual machine to backend pool wizard; Select the VMs (myvm1, myvm2) and then click add.
The third VM (myvmtest) is for testing Internet load balancing.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

4- After selecting the virtual machine, then click on Add.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

5- So the backend pool has been configured successfully. Then inside Load Balancer, select Health Probes.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Health Probe

1- Click on + Add.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- Enter a name to the Health Probe.
Protocol (HTTP)
The interval shows that it is going to make a probe attempt at 5-second intervals. And the unhealthy threshold shows that after 2 failed probe attempts, it is going to declare it as an unhealthy server.
Click ok.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

3- Health probe successfully created, click on Load Balancing Rules.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Load Balancing Rules

1- Click on + Add button

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- Add load balancing rule wizard, enter a name
The IP version is IPv4
Select frontend IP Address
Protocol is TCP, port number is 80
Backend port 80, backend pool is the one that we have just created & the health probe is the one that we have just created.
By default Session persistence is none & idle timeout is 4 minutes. Floating IP disabled. Click on OK.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Test Internal Load Balancer in Microsoft Azure

1- Click on load balancer (webserverlb)

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

2- In the Load Balancer, I have my Private IP address. Copy it and then paste it in the explorer address bar using the third VM (myvmtest).

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

3- On the first hit, it has taken me to myvm1 server.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

4- Wait for 4 minutes then hit enter again, it is take you to myvm2 server.

Internal Load Balancer in Microsoft Azure, Internal Load Balancer in Microsoft Azure

Written by Jamil Parvez

Jamil Pervez works as a Network Administrator, based in Kuwait with a Primary focus on Microsoft technologies. Microsoft Certified MCSE, MCTP, MCITP, CCNP, CCIP, CCVP with 20 years of experience in administering Windows Servers, Exchange, VMWare, Veeam B&R, Veritas BackupExec.

Leave a Reply

, 8 Topics for Research and Thesis in Artificial Intelligence

8 Topics for Research and Thesis in Artificial Intelligence

, How to Create VPC Peering Connection Same Region in AWS

How to Create VPC Peering Connection Same Region in AWS