1
  1. Created 2 Ubuntu VMs in same availability Set, region, virtual network with apache2 installed.
  2. Renamed the index.html of both the VMs to: "This is VM1", "This is VM2".
  3. Created Internal Load Balancer with the below Configuration:
  • Front End IP Configuration: Same VNet, Dynamic Assignment, Zone-Redundant as Availability Zone
  • Back End Pool: Selected 2 VMs on the bepool
  • Health Probe: TCP Protocol, Port 80
  • Load Balancing Rule: TCP - 443 Port, Selected the created bepool and health probe, TCP Reset - Enabled, Idle Time out - 4 minutes
  • Inbound NAT Rules - Same as LB Rule but the port is 80.

The Problem is: When I copy the Front End IP of the Load Balancer and pasting in the browser, it is not showing any output like:

enter image description here

On VM Side, I have enabled the ports 80, 443, and 22 in the NSG for both of the VMs.

If that output comes, then I can hit the refresh page many times to see the load is distributing between the two VMs that shows "This is VM1" from VM2.

1 Answers1

3

I tried to reproduce the same in my environment and got the results like below:

I have created a virtual machine with:

  • VM 1 as availability zone zone 1 with Inbound port as HTTP(80) and SSH (22)
  • VM 2 as availability zone zone 2 with inbound port as HTTP(80) and SSH (22)

Then I have installed Apache web server Renamed the index.html for both vm like below:

Vm1

enter image description here

VM2

enter image description here

Created a load balancer type select as public in frontend ip created new public ip:

enter image description here

Added two virtual machines in backend pool and Add health probe. After creating load balancer verify public Ip address are same assigned in your both virtual machine.

Then add Load balancer rule port 80 like below:

enter image description here

Now, when I copy the Frontend IP of the Load Balancer and pasting in the browser I got result successfully like below:

enter image description here

enter image description here

Sometimes if we refresh, we can't redirect to another server keep being active on the server open another tab refresh it it will redirect multiple vm

Update

I have created two ubuntu vm with availability set on same region and vnet of Apache installed.

enter image description here

Then created with Internal Load Balancer:

enter image description here

Then added same Front End IP -> Back End Pool -> Health Probe -> And Load Balancing Rule TCP as 80 port

According to MSDocs

If your application hosted in the backend VM of an internal load balancer is trying to access another application hosted in the same backend VM over the same network interface, it's an unsupported scenario and will fail.

You need to create another test virtual machine with windows server to access RDP with same virtual network or while peering vnet you can access it while peering Basic LB has some limitations over Vnet peering

I have created another Vm and connected to remote desktop here, when I try to access Front end IP of the Load Balancer, I got result successfully like below.

enter image description here enter image description here

Imran
  • 3,875
  • 2
  • 3
  • 12
  • Hey Imran, check the question clearly. I have done in availability set and mentioned tags as azure availability set. –  Dec 27 '22 at 09:24
  • Have you read the question clearly .. and i selected the load balancer as internal but you have taken public lb. –  Dec 27 '22 at 09:26
  • 1
    Kindly, Check the Updated answer. Apologies for missing the point. – Imran Dec 27 '22 at 13:48
  • Is Inbound NAT Rule not required in the load balancer for Linux VMs? because I used Inbound NAT Rule in Windows VM Internal Load Balancer Testing, it worked. And one last doubt is Is Inbound NAT Rule required only for Windows VM or not required at all. Why it is used? –  Dec 27 '22 at 16:09
  • Can you elaborate your explanation. not required means why it is not required? –  Dec 27 '22 at 16:12
  • In your previous deleted comment, you said that Inbound NAT Rule is not required. can you elaborate the explanation why it is not required as I have asked in above comment. –  Dec 27 '22 at 16:14
  • Could you clarify this doubt so that I would accept the answer which helped me. –  Dec 27 '22 at 16:20
  • An inbound NAT rule is used to forward traffic from a load balancer frontend to one or more instances in the backend pool. without Inbound NAT rules also the load balancing works As the LB itself is private [refer](https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-faqs#how-are-inbound-nat-rules-different-from-load-balancing-rules-) to more in detail [Inbound NAT rules - Azure Load Balancer | Microsoft Learn](https://learn.microsoft.com/en-us/azure/load-balancer/inbound-nat-rules) – Imran Dec 27 '22 at 16:58
  • If my question is valid with all input, output, error and my efforts, please do upvote on question. –  Dec 27 '22 at 17:29