You are on page 1of 11

Translated from French to English - www.onlinedoctranslator.

com

Dr. Fatma SIALA Kallel

Create a public basic load balancer to load


VMs using the Azure portal

Learn how to get started with Azure Load Balancer by using the Azure portal to
create a public load balancer and three VMs.

Prerequisites

● Azure account with an active subscription.Create a free account .

Connecting to Azure

Log in to the Azure portal athttps://portal.azure.com .

● Standard reference
● Basic Reference
Ratings

It is recommended to have a Standard SKU load balancer for production workloads.


For more information on part numbers (SKUs), seeAzure Load Balancer SKUs .

1
Dr. Fatma SIALA Kallel

Figure: Resources created in the quick start guide.

In this section, you create a load balancer that balances the load of virtual machines.

When you create a public load balancer, you create a public IP address configured
as the front-end (namedLoadBalancerFrontenddefault) for the load balancer.

1. In the upper left corner of the screen, clickCreate Resource > Networking > Load
Balancer.
2. In the tabBasic functionsof the pageCreate a load balancer,enter or select the
following information:

TABLE 1
Setting Value
Subscription Select your subscription.
Resource group SelectCreate,then enterCreatePubLBQS-rgin the text box.

Name Come inmyLoadBalancer


Region SelectWestern Europe.
Kind SelectAudience.
SKUs selectStandard.
Address IPsSelectCreate new.If you have an existing public IP address that
public you want to use, selectUse the existing.
Name of TypemyPublicIPin the text box.
IP address
public
Area of SelectZone redundantto create a resilient load balancer. To
availablity create a zonal load balancer, select a specific zone from 1, 2, or 3

Add a SelectNo.
IPv6 address For more information about IPv6 addresses and the load
public balancer, seeWhat is Azure Virtual Network IPv6?

3. Accept the defaults for the remaining settings, then selectCheck + create.

4. Under the tabReview + create,selectCreate.

2
Dr. Fatma SIALA Kallel

Create load balancer resources


In this section, you configure:

1.The load balancer settings of a backend address pool


2.An integrity probe
3.A load balancer rule

1.Create a primary pool

A backend address pool contains the IP addresses of virtual NICs connected to the
load balancer.

Create the main address poolmyBackendPoolto include virtual machines for load
balancing Internet traffic.

3
Dr. Fatma SIALA Kallel

1. SelectAll the servicesin the left menu,All resources, ThenmyLoadBalancerin the


resource list.
2. UnderSettings,selectmain pools,ThenAdd.
3. In the pageAdd a pool of backends,Come inmyBackendPoolas the name of your
primary pool, then selectAdd.

2.Create a health probe

The load balancer monitors the state of your application with a health probe.

The health probe adds or removes virtual machines in the load balancer based on
their response to health checks.

Create a named health probemyHealthProbeto monitor the health of virtual


machines.

1. SelectAll the servicesin the left menu,All resources, ThenmyLoadBalancerin the


resource list.
2. UnderSettings,selectIntegrity probes,ThenAdd.

CHART 2
Setting Value
Name Come inMyHealthProbe.
Protocol SelectHTTP.
Port Come in80.

Interval Come in15Forthe intervalin seconds between probe retries.


Threshold of Select2for theIntegrity Failure Threshold, is the number of
failure on THEconsecutive probe failures that can occur before a virtual
integrity plan machine is considered unhealthy.

3. Leave the other defaults and selectOK.

3.Create a load balancer rule

A load balancing rule is used to define the distribution of traffic to virtual machines.
You define the front-end IP configuration for incoming traffic and the back-ends IP
address pool for receiving traffic. Source and destination ports are defined in the
rule.

In this section, you will create a load balancer rule:

● Has a namemyHTTPRule.
● Can be found in the front-end namedLoadBalancerFrontEnd.
● Listen on theHarbor 80.
● Directs load-balanced traffic to the named back-endmyBackendPoolon the
Harbor 80.

4
Dr. Fatma SIALA Kallel

1. SelectAll the servicesin the left menu,All resources, ThenmyLoadBalancerin the


resource list.
2. UnderSettings,selectLoad balancing rules,ThenAdd.
3. To configure the load balancing policy, use the following values:

TABLE 3
Setting Value
Name Come inMyHTTPRule.
IP address version SelectIPv4
Front-end server IP SelectLoadBalancerFrontEnd
address
Protocol SelectTCP.
Port Come in80.

main port Come in80.

Main pool SelectMyBackendPool.


Integrity probe SelectmyHealthProbe.
Time limit of inactivity Move the cursor to15 minutes.
(minutes)
Reset of SelectEnabled.
TCP protocol
Translation of addresses Select (Recommended) Use outbound rules to provide
network (SNAT) sources backend pool members with Internet access.
outgoing

4. Leave the other defaults, then selectOK.

Create main servers


In this section, you will:

● Create a virtual network.


● Create three VMs for the load balancer backend pool.

● Install IIS on the virtual machines to test the load balancer.

Create a virtual network


In this section, you will create a virtual network and a subnet.

1. At the top left of the screen, selectCreate Resource > Network > Virtual Network,
or searchvirtual networkfrom the search box.
2. InCreate a virtual network,enter or select the following information under the
tabGeneral :

5
Dr. Fatma SIALA Kallel

TABLE 4
Setting Value
Project details
Subscription Select your Azure subscription
Resource group SelectCreatePubLBQS-rg.
Instance details
Name Come inmyVNet
Region SelectWestern Europe

3. Select the tabIP addresses,or select the buttonFollowing :


IP addressesat the bottom of the page.
4. Under the tabIP addresses,enter the following information:

CHART 5
Setting Value
IPv4 address space Come in10.1.0.0/16

5. UnderSubnet name,select the wordby default.


6. InModify the subnet,enter the following information:

CHART 6
Setting Value
Subnet name Come inmyBackendSubnet
Subnet address range Come in10.1.0.0/24

7. SelectRegister.
8. Select the tabSecurity .
9. UnderBastionHost,selectEnable.Enter the following information:

CHART 7
Setting Value
stronghold name Come inmyBastionHost
AzureBastionSubnet address space Come in10.1.1.0/24
Public IP address SelectCreate new.
ForName, Come inmyBastionIP.
SelectOK.

10. Select the tabCheck + create,or select the buttonCheck + create.


11. SelectCreate (Create).

Create virtual machines

In this
section, YOU Go on create three machinery virtual
(myVM1, myVM2AndmyVM3)in three different areas (Area 1, Area 2AndArea 3).

6
Dr. Fatma SIALA Kallel

These VMs are added to the load balancer backend pool created earlier.

1. At the top left of the portal, selectCreate Resource > Compute > Virtual Machine.

2. InCreate a virtual machine,type or select the values under the tabBasic :

CHART 8
Setting Value
Project details
Subscription Select your Azure subscription
Resource group SelectCreatePubLBQS-rg.
Instance details
Virtual machine name Come inmyVM1

Region SelectWestern Europe


Availability options SelectAvailability Zones
Availability Zone Select1
Picture SelectWindows Server 2019 Datacenter
Azure Spot Instance SelectNo
Size Choose the size of the virtual machine or accept the default
setting
Administrator account
username Enter a username
Password Enter a password
Confirm password Reenter password

Rules of the ports


input
No entry port SelectNone
audience

3. Select the tabNetworkingor chooseNext: Records,ThenNext: Networking.

4. Under the Network tab, select or enter:

CHART 9
Setting Value
Network interface
virtual network myVNet
Subnet myBackendSubnet
Public IP address SelectNone.

7
Dr. Fatma SIALA Kallel

CHART 9
Setting Value
Network adapter network security SelectAdvance
group
Configure a network security group SelectCreate new.
InCreate a network security group, Come in
myNSGInName. BelowRules
of traffic entering,
select +Add an inbound rule.

BelowDestination port ranges,Come in80.


BelowPriority, Come in100.
InName, Come inmyHTTPRule
SelectAdd
SelectOK.
Load balancing
Place this virtual machine behind an SelectYes.
existing load balancing solution?

Load balancing settings


Load balancing options SelectAzure Load Balancing
Select a load balancer SelectmyLoadBalancer
Select a primary pool SelectmyBackendPool

5. Select the tabManagementor selectNext > Management.


6. Under the tabManagement,select or enter:

CHART 10
Setting Value
Surveillance
Boot diagnostics SelectDisabled

7. SelectReview + create.
8. Review the settings, then selectCreate.
9. Follow steps 1-8 to create two additional VMs with the following values and all
other settings the same asmyVM1:

CHART 11
Setting Virtual machine 2 Virtual machine 3
Name myVM2 myVM3
Availability Zone 2 3
Security group Select THE
Select THE
network bandmyNSGexisting bandmyNSGexisting

3.Create outbound rule configuration


8
Dr. Fatma SIALA Kallel

Load balancer outbound rules configure outbound SNAT for VMs in the backend
pool.

For more information on outbound connections, seeOutbound connections in Azure


.

Create an outbound rule

1. SelectAll the servicesin the left menu,All resources, ThenmyLoadBalancerin the


resource list.
2. UnderSettings,selectoutgoing traffic rules,ThenAdd.
3. To configure outbound rules, use the following values:

CHART 12
Setting Value
Name Come inmyOutboundRule.
Front-end server IP SelectCreate new.
address InName, Come inLoadBalancerFrontEndOutbound.
SelectAddress IPsOrPrefix of address IP.
SelectCreatebelowPublic IP addressOrIP address prefix
public.
For Name,
Come inmyPublicIPOutboundOr
myPublicIPPrefixOutbound. SelectAdd.
Time limit of inactivity Move the cursor to15 minutes.
(minutes)
Reset of SelectEnabled.
TCP protocol
Main pool SelectCreate new.
Come inmyBackendPoolOutboundInName.
SelectAdd.
Port Allocation -> SelectManually choose the number of output ports
Port Allocation
Output Ports -> SelectPorts per instance
Choose By
Output Ports -> Come in10000.
Ports Per Instance

4. SelectAdd.

Add virtual machines to the outbound pool

1. SelectAll the servicesin the left menu,All resources, ThenmyLoadBalancerin the


resource list.
2. UnderSettings,selectBackend Pools .
3. SelectmyBackendPoolOutbound.
4. Invirtual network,selectmyVNet.
5. Invirtual machines,select +Add.

9
Dr. Fatma SIALA Kallel

6. Check the boxes next tomyVM1, myVM2AndmyVM3.


7. SelectAdd.
8. SelectRegister.

Install IIS
1. SelectAll the servicesin the menu on the left, selectAll resourcesthen, in the list
of resources, selectmyVM1which is in the resource groupCreatePubLBQS-rg.

2. In the pageOverview,selectTo log in,ThenBastion.


3. Enter the username and password entered during the creation of the virtual
machine.
4. SelectConnect.
5. On the server desktop, navigate toWindows Administrative Tools > Windows
PowerShell.
6. In the PowerShell window, run the following commands to:
oh Install IIS Server
oh Delete the default iisstart.htm file
oh Add a new iisstart.htm file that displays the virtual machine name:

PowerShellCopy

# install IIS server role


Install-WindowsFeature-nameWeb-Server-Include ManagementTools

# remove default htm file


remove itemC:\inetpub\wwwroot\iisstart.htm

# Add a new htm file that displays server name


Add-Content-Path"C:\inetpub\wwwroot\iisstart.htm"-Value$("Hello World from"+
$env:computername)

7. Close the Bastion session withmyVM1.


8. Repeat steps 1-6 to install IIS and the updated iisstart.htm file onmyVM2And
myVM3.

Test the load balancer


1. Find the load balancer's public IP address on the screenOverview.SelectAll the
servicesin the menu on the left, selectAll resources,then selectmyPublicIP.

2. Copy the public IP address and paste it into your browser's address bar. The
default IIS web server page is displayed on the browser.

10
Dr. Fatma SIALA Kallel

To see the load balancer distribute traffic among the three VMs, you can customize
each VM's default IIS web server page and then force your browser to refresh from
the client machine.

Clean up resources
When you no longer need them, delete the resource group, load balancer, and all
associated resources. To do this, select the resource groupCreatePubLBQS-rgthat
contains the resources, then selectDELETE.

11

You might also like