Skip to content

Commit f516872

Browse files
committed
Update load balancer steps
1 parent 16e133c commit f516872

File tree

4 files changed

+265
-35
lines changed

4 files changed

+265
-35
lines changed

articles/sap/workloads/sap-hana-high-availability.md

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -83,52 +83,36 @@ The preceding figure shows an *example* load balancer that has these configurati
8383
- Front-end IP address: 10.0.0.13 for HN1-db
8484
- Probe port: 62503
8585

86-
## Deploy for Linux
86+
## Prepare the infrastructure
8787

8888
The resource agent for SAP HANA is included in SUSE Linux Enterprise Server for SAP Applications. An image for SUSE Linux Enterprise Server for SAP Applications 12 or 15 is available in Azure Marketplace. You can use the image to deploy new VMs.
8989

9090
### Deploy Linux VMs manually via Azure portal
9191

9292
This document assumes that you've already deployed a resource group, [Azure Virtual Network](../../virtual-network/virtual-networks-overview.md), and subnet.
9393

94-
Deploy virtual machines for SAP HANA. Choose a suitable SLES image that is supported for HANA system. You can deploy VM in any one of the availability options - scale set, availability zone or availability set.
94+
Deploy virtual machines for SAP HANA. Choose a suitable SLES image that is supported for HANA system. You can deploy VM in any one of the availability options - virtual machine scale set, availability zone, or availability set.
9595

9696
> [!IMPORTANT]
9797
> Make sure that the OS you select is SAP certified for SAP HANA on the specific VM types that you plan to use in your deployment. You can look up SAP HANA-certified VM types and their OS releases in [SAP HANA Certified IaaS Platforms](https://www.sap.com/dmc/exp/2014-09-02-hana-hardware/enEN/#/solutions?filters=v:deCertified;ve:24;iaas;v:125;v:105;v:99;v:120). Make sure that you look at the details of the VM type to get the complete list of SAP HANA-supported OS releases for the specific VM type.
9898
99-
During VM configuration, you have an option to create or select exiting load balancer in networking section. If you are creating a new load balancer, follow below steps -
100-
101-
1. Set up a standard load balancer.
102-
1. Create a front-end IP pool:
103-
1. Open the load balancer, select **frontend IP pool**, and then select **Add**.
104-
2. Enter the name of the new front-end IP pool (for example, **hana-frontend**).
105-
3. Set **Assignment** to **Static** and enter the IP address (for example, **10.0.0.13**).
106-
4. Select **OK**.
107-
5. After the new front-end IP pool is created, note the pool IP address.
108-
109-
2. Create a single back-end pool:
110-
1. In the load balancer, select **Backend pools**, and then select **Add**.
111-
2. Enter the name of the new back-end pool (for example, **hana-backend**).
112-
3. For **Backend Pool Configuration**, select **NIC**.
113-
4. Select **Add a virtual machine**.
114-
5. Select the VMs that are in the HANA cluster.
115-
6. Select **Add**.
116-
7. Select **Save**.
117-
118-
3. Create a health probe:
119-
1. In the load balancer, select **health probes**, and then select **Add**.
120-
2. Enter the name of the new health probe (for example, **hana-hp**).
121-
3. For **Protocol**, select **TCP** and select port **625\<instance number\>**. Keep **Interval** set to **5**.
122-
4. Select **OK**.
123-
124-
4. Create the load-balancing rules:
125-
1. In the load balancer, select **load balancing rules**, and then select **Add**.
126-
2. Enter the name of the new load balancer rule (for example, **hana-lb**).
127-
3. Select the front-end IP address, the back-end pool, and the health probe that you created earlier (for example, **hana-frontend**, **hana-backend**, and **hana-hp**).
128-
4. Increase the idle timeout to 30 minutes.
129-
5. Select **HA Ports**.
130-
6. Enable **Floating IP**.
131-
7. Select **OK**.
99+
### Configure Azure load balancer
100+
101+
During VM configuration, you have an option to create or select exiting load balancer in networking section. Follow below steps, to setup standard load balancer for high availability setup of HANA database.
102+
103+
#### [Azure Portal](#tab/lb-portal)
104+
105+
[!INCLUDE [Configure Azure standard load balancer using Azure portal](../../../includes/sap-load-balancer-db-portal.md)]
106+
107+
#### [Azure CLI](#tab/lb-azurecli)
108+
109+
[!INCLUDE [Configure Azure standard load balancer using Azure CLI](../../../includes/sap-load-balancer-db-azurecli.md)]
110+
111+
#### [PowerShell](#tab/lb-powershell)
112+
113+
[!INCLUDE [Configure Azure standard load balancer using PowerShell](../../../includes/sap-load-balancer-db-powershell.md)]
114+
115+
---
132116

133117
For more information about the required ports for SAP HANA, read the chapter [Connections to Tenant Databases](https://help.sap.com/viewer/78209c1d3a9b41cd8624338e42a12bf6/latest/en-US/7a9343c9f2a2436faa3cfdb5ca00c052.html) in the [SAP HANA Tenant Databases](https://help.sap.com/viewer/78209c1d3a9b41cd8624338e42a12bf6) guide or [SAP Note 2388694][2388694].
134118

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: include file
3+
description: include file
4+
services: load-balancer
5+
ms.service: sap-on-azure
6+
ms.topic: include
7+
ms.date: 01/10/2024
8+
author: dennispadia
9+
ms.author: depadia
10+
---
11+
12+
```azurecli-interactive
13+
# Create the load balancer resource with frontend IP. Allocation of private IP address is dynamic using below command. If you want to pass static IP address, include parameter --private-ip-address.
14+
az network lb create -g MyResourceGroup -n MyLB --sku Standard --vnet-name MyVMsVirtualNetwork --subnet MyVMsSubnet --backend-pool-name MyBackendPool --frontend-ip-name MyDBFrontendIpName
15+
16+
# Create the health probe for ASCS and ERS
17+
az network lb probe create -g MyResourceGroup --lb-name MyLB -n MyDBHealthProbe --protocol tcp --port MyDBHealthProbePort --interval 5 --probe-threshold 2
18+
19+
# Create load balancing rule for ASCS and ERS
20+
az network lb rule create -g MyResourceGroup --lb-name MyLB -n MyDBRuleName --protocol All --frontend-ip-name MyDBFrontendIpName --frontend-port 0 --backend-pool-name MyBackendPool --backend-port 0 --probe-name MyDBHealthProbe --idle-timeout-in-minutes 30 --enable-floating-ip
21+
22+
# Add ASCS and ERS VMs in backend pool
23+
az network nic ip-config address-pool add --address-pool MyBackendPool --ip-config-name DBVm1IpConfigName --nic-name DBVm1NicName -g MyResourceGroup --lb-name MyLB
24+
az network nic ip-config address-pool add --address-pool MyBackendPool --ip-config-name DBVm2IpConfigName --nic-name DBVm2NicName -g MyResourceGroup --lb-name MyLB
25+
```
26+
27+
<details>
28+
<summary>Expand to view full CLI code</summary>
29+
30+
```azurecli-interactive
31+
# Define variables for Resource Group, and Database VMs.
32+
33+
rg_name="resourcegroup-name"
34+
vm1_name="db1-name"
35+
vm2_name="db2-name"
36+
37+
# Define variables for the load balancer that will be utilized in the creation of the load balancer resource.
38+
39+
lb_name="sap-db-sid-ilb"
40+
bkp_name="db-backendpool"
41+
db_fip_name="db-frontendip"
42+
43+
db_hp_name="db-healthprobe"
44+
db_hp_port="625<instance-no>"
45+
46+
db_rule_name="db-lb-rule"
47+
48+
# Command to get VMs network information like primary NIC name, primary IP configuration name, virtual network name, and subnet name.
49+
50+
vm1_primary_nic=$(az vm nic list -g $rg_name --vm-name $vm1_name --query "[?primary == \`true\`].{id:id} || [?primary == \`null\`].{id:id}" -o tsv)
51+
vm1_nic_name=$(basename $vm1_primary_nic)
52+
vm1_ipconfig=$(az network nic ip-config list -g $rg_name --nic-name $vm1_nic_name --query "[?primary == \`true\`].name" -o tsv)
53+
54+
vm2_primary_nic=$(az vm nic list -g $rg_name --vm-name $vm2_name --query "[?primary == \`true\`].{id:id} || [?primary == \`null\`].{id:id}" -o tsv)
55+
vm2_nic_name=$(basename $vm2_primary_nic)
56+
vm2_ipconfig=$(az network nic ip-config list -g $rg_name --nic-name $vm2_nic_name --query "[?primary == \`true\`].name" -o tsv)
57+
58+
vnet_subnet_id=$(az network nic show -g $rg_name -n $vm1_nic_name --query ipConfigurations[0].subnet.id -o tsv)
59+
vnet_name=$(basename $(dirname $(dirname $vnet_subnet_id)))
60+
subnet_name=$(basename $vnet_subnet_id)
61+
62+
# Create the load balancer resource with frontend IP.
63+
# Allocation of private IP address is dynamic using below command. If you want to pass static IP address, include parameter --private-ip-address.
64+
65+
az network lb create -g $rg_name -n $lb_name --sku Standard --vnet-name $vnet_name --subnet $subnet_name --backend-pool-name $bkp_name --frontend-ip-name $db_fip_name
66+
67+
# Create the health probe
68+
69+
az network lb probe create -g $rg_name --lb-name $lb_name -n $db_hp_name --protocol tcp --port $db_hp_port --interval 5 --probe-threshold 2
70+
71+
# Create load balancing rule
72+
73+
az network lb rule create -g $rg_name --lb-name $lb_name -n $db_rule_name --protocol All --frontend-ip-name $db_fip_name --frontend-port 0 --backend-pool-name $bkp_name --backend-port 0 --probe-name $db_hp_name --idle-timeout-in-minutes 30 --enable-floating-ip
74+
75+
# Add database VMs in backend pool
76+
77+
az network nic ip-config address-pool add --address-pool $bkp_name --ip-config-name $vm1_ipconfig --nic-name $vm1_nic_name -g $rg_name --lb-name $lb_name
78+
az network nic ip-config address-pool add --address-pool $bkp_name --ip-config-name $vm2_ipconfig --nic-name $vm2_nic_name -g $rg_name --lb-name $lb_name
79+
80+
# [OPTIONAL] Change the assignment of frontend IP address from dynamic to static
81+
dbfip=$(az network lb frontend-ip show --lb-name $lb_name -g $rg_name -n $db_fip_name --query "{privateIPAddress:privateIPAddress}" -o tsv)
82+
az network lb frontend-ip update --lb-name $lb_name -g $rg_name -n $db_fip_name --private-ip-address $dbfip
83+
```
84+
85+
</details>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: include file
3+
description: include file
4+
services: load-balancer
5+
ms.service: sap-on-azure
6+
ms.topic: include
7+
ms.date: 01/10/2024
8+
author: dennispadia
9+
ms.author: depadia
10+
---
11+
12+
Follow [create load balancer](https://learn.microsoft.com/azure/load-balancer/quickstart-load-balancer-standard-internal-portal#create-load-balancer) guide to set up a standard load balancer for a high availability SAP system using the Azure portal. During the set up of load balancer, follow below consideration.
13+
14+
1. **Frontend IP Configuration:** Create frontend IP. Select the same virtual network and subnet as that of your ASCS/ERS virtual machines.
15+
2. **Backend Pool:** Create backend pool and add DB VMs.
16+
3. **Inbound rules:** Create load balancing rule. Follow the same steps for both load balancing rules.
17+
- Frontend IP address: Select frontend IP
18+
- Backend pool: Select backend pool
19+
- Check "High availability ports"
20+
- Protocol: TCP
21+
- Health Probe: Create health probe with below details
22+
- Protocol: TCP
23+
- Port: [eg: 625<instance-no.>]
24+
- Interval: 5
25+
- Idle timeout (minutes): 30
26+
- Check "Enable Floating IP"
27+
28+
> [!NOTE]
29+
>
30+
> Health probe configuration property numberOfProbes, otherwise known as "Unhealthy threshold" in Portal, isn't respected. So to control the number of successful or failed consecutive probes, set the property "probeThreshold" to 2. It is currently not possible to set this property using Azure portal, so use either the [Azure CLI](https://learn.microsoft.com/cli/azure/network/lb/probe?view=azure-cli-latest) or [PowerShell](https://learn.microsoft.com/powershell/module/az.network/new-azloadbalancerprobeconfig?view=azps-11.1.0) command.
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: include file
3+
description: include file
4+
services: load-balancer
5+
ms.service: sap-on-azure
6+
ms.topic: include
7+
ms.date: 01/10/2024
8+
author: dennispadia
9+
ms.author: depadia
10+
---
11+
12+
```azurecli-interactive
13+
# Create frontend IP configurations
14+
$db_fip = New-AzLoadBalancerFrontendIpConfig -Name MyDBFrontendIpName -SubnetId MyDBSubnetName
15+
16+
# Create backend pool
17+
$bePool = New-AzLoadBalancerBackendAddressPoolConfig -Name MyBackendPool
18+
19+
# Create health probes for ASCS and ERS
20+
$db_healthprobe = New-AzLoadBalancerProbeConfig -Name MyDBHealthProbe -Protocol 'tcp' -Port MyDBHealthProbePort -IntervalInSeconds 5 -ProbeThreshold 2 -ProbeCount 1
21+
22+
# Create load balancing rules for ASCS and ERS
23+
$db_rule = New-AzLoadBalancerRuleConfig -Name MyDBRuleName -Probe $db_healthprobe -Protocol 'All' -IdleTimeoutInMinutes 30 -FrontendIpConfiguration $db_fip -BackendAddressPool $bePool -EnableFloatingIP
24+
25+
# Create the load balancer resource
26+
$lb = New-AzLoadBalancer -ResourceGroupName MyResourceGroup -Name MyLB -Location MyRegion -Sku 'Standard' -FrontendIpConfiguration $db_fip -BackendAddressPool $bePool -LoadBalancingRule $db_rule -Probe $db_healthprobe
27+
```
28+
29+
<details>
30+
<summary>Expand to view full PowerShell code</summary>
31+
32+
```azurepowershell-interactive
33+
# Define variables for Resource Group, and Database VMs.
34+
35+
$rg_name = 'resourcegroup-name'
36+
$vm1_name = 'db1-name'
37+
$vm2_name = 'db2-name'
38+
39+
# Define variables for the load balancer that will be utilized in the creation of the load balancer resource.
40+
41+
$lb_name = 'sap-db-sid-ilb'
42+
$bkp_name = 'db-backendpool'
43+
$db_fip_name = 'db-frontendip'
44+
45+
$db_hp_name = 'db-healthprobe'
46+
$db_hp_port = '625<instance-no>'
47+
48+
$db_rule_name = 'db-lb-rule'
49+
50+
# Command to get VMs network information like primary NIC name, primary IP configuration name, virtual network name, and subnet name.
51+
52+
$vm1 = Get-AzVM -ResourceGroupName $rg_name -Name $vm1_name
53+
$vm1_primarynic = $vm1.NetworkProfile.NetworkInterfaces | Where-Object {($_.Primary -eq "True") -or ($_.Primary -eq $null)}
54+
$vm1_nic_name = $vm1_primarynic.Id.Split('/')[-1]
55+
56+
$vm1_nic_info = Get-AzNetworkInterface -Name $vm1_nic_name -ResourceGroupName $rg_name
57+
$vm1_primaryip = $vm1_nic_info.IpConfigurations | Where-Object -Property Primary -EQ -Value "True"
58+
$vm1_ipconfig_name = ($vm1_primaryip).Name
59+
60+
$vm2 = Get-AzVM -ResourceGroupName $rg_name -Name $vm2_name
61+
$vm2_primarynic = $vm2.NetworkProfile.NetworkInterfaces | Where-Object {($_.Primary -eq "True") -or ($_.Primary -eq $null)}
62+
$vm2_nic_name = $vm2_primarynic.Id.Split('/')[-1]
63+
64+
$vm2_nic_info = Get-AzNetworkInterface -Name $vm2_nic_name -ResourceGroupName $rg_name
65+
$vm2_primaryip = $vm2_nic_info.IpConfigurations | Where-Object -Property Primary -EQ -Value "True"
66+
$vm2_ipconfig_name = ($vm2_primaryip).Name
67+
68+
$vnet_name = $vm1_primaryip.Subnet.Id.Split('/')[-3]
69+
$subnet_name = $vm1_primaryip.Subnet.Id.Split('/')[-1]
70+
$location = $vm1.Location
71+
72+
# Create frontend IP resource.
73+
# Allocation of private IP address is dynamic using below command. If you want to pass static IP address, include parameter -PrivateIpAddress
74+
75+
$db_lb_fip = @{
76+
Name = $db_fip_name
77+
SubnetId = $vm1_primaryip.Subnet.Id
78+
}
79+
$db_fip = New-AzLoadBalancerFrontendIpConfig @db_lb_fip
80+
81+
# Create backend pool
82+
83+
$bepool = New-AzLoadBalancerBackendAddressPoolConfig -Name $bkp_name
84+
85+
# Create the health probe
86+
87+
$db_probe = @{
88+
Name = $db_hp_name
89+
Protocol = 'tcp'
90+
Port = $db_hp_port
91+
IntervalInSeconds = '5'
92+
ProbeThreshold = '2'
93+
ProbeCount = '1'
94+
}
95+
$db_healthprobe = New-AzLoadBalancerProbeConfig @db_probe
96+
97+
# Create load balancing rule
98+
99+
$db_lbrule = @{
100+
Name = $db_rule_name
101+
Probe = $db_healthprobe
102+
Protocol = 'All'
103+
IdleTimeoutInMinutes = '30'
104+
FrontendIpConfiguration = $db_fip
105+
BackendAddressPool = $bePool
106+
}
107+
$db_rule = New-AzLoadBalancerRuleConfig @db_lbrule -EnableFloatingIP
108+
109+
# Create the load balancer resource
110+
111+
$loadbalancer = @{
112+
ResourceGroupName = $rg_name
113+
Name = $lb_name
114+
Location = $location
115+
Sku = 'Standard'
116+
FrontendIpConfiguration = $db_fip
117+
BackendAddressPool = $bePool
118+
LoadBalancingRule = $db_rule
119+
Probe = $db_healthprobe
120+
}
121+
$lb = New-AzLoadBalancer @loadbalancer
122+
123+
# Add DB VMs in backend pool
124+
125+
$vm1_primaryip.LoadBalancerBackendAddressPools.Add($lb.BackendAddressPools[0])
126+
$vm2_primaryip.LoadBalancerBackendAddressPools.Add($lb.BackendAddressPools[0])
127+
$vm1_nic_info | Set-AzNetworkInterface
128+
$vm2_nic_info | Set-AzNetworkInterface
129+
```
130+
131+
</details>

0 commit comments

Comments
 (0)