After successful cloud configuration, create a virtual service on NSX Advanced Load Balancer. The recommended configuration is to have two virtual services(one L7 VS and one L4 VS) having the same virtual IP (VIP).
The following are the configuration steps for load balancing UAG.
Procedure
- Create a custom health monitor for UAG.
- From the UI, navigate to Templates > Profiles > Health Monitors.
- Click Create.
- Select the Azure Cloud that was created for Horizon.
- Enter the following details in the New Health Monitor screen.
Field
Value
Send Interval
30
Receive Timeout
10
Client Requested Data
GET /favicon.ico HTTP/1.0
Response Code
2xx
- Click Save.
- Create Pools
Before creating the UAG L7 pool, create the SSL profile to be used for the UAG L7 pool.
Create an SSL Profile for the UAG pool with the configuration given below:
Accepted Versions: 1.2
Cipher List:
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
- Navigate to Templates > SSL/TLS Profile > Create.
- Select Application Profile.
- Enter the required fields in the New SSL/TLS Profile screen.
- Click Ciphers tab and select the following ciphers
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
- Click Save.
The following are the steps to create the UAG L7 Pool:
- Navigate to Applications > Pools.
- Select the Azure cloud from the Select Cloud sub-screen and click Next.
- Click Create Pool.
- In the New Pool screen, update the details as shown below:
- Click Next.
- In the Servers tab, add the Server IP Address of the UAG servers and click Add Server.
- Click Save.
To configure UAG L4 Pool:
Follow the steps shown under UAG L7 Pool but with the configuration shown below:
- Install SSL Certificate
The SSL connection is being terminated at NSX Advanced Load Balancer virtual service. Therefore, the SSL certificate must be assigned to the virtual service. It is advised to install a certificate which is signed by a valid certificate authority instead of using self-signed certificates. Install the certificate in NSX Advanced Load Balancer, and ensure the CA certificate is imported and linked. For instructions, see SSL Certificates topic in the VMware NSX Advanced Load Balancer Configuration Guide.
- Disable Connection Multiplexing
In UAG load balancing, deactivate connection multiplexing for the System-Secure-HTTP-VDI profile.
- Navigate to Templates > Profiles > Application > System-Secure-HTTP-VDI.
- Click the edit icon.
- Disable Connection Multiplex as shown below:
- Click Save.
- Create an SSL Profile for Virtual Service
Create an SSL Profile for the virtual service with the configuration given below:
- Navigate to Templates > SSL/TLS Profile > Create.
- Select Application Profile.
- Enter the details below:
Accepted Versions: TLS 1.1, 1.2
Cipher List:
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- Click Save.
- Create an L7 Virtual Service and HTTP request policies
- Navigate to Applications > Virtual Services .
- Click Create Virtual Service > Advanced Setup.
- Use the System-Secure-HTTP-VDI as the Application Profile.
- Select the SSL profile created in the previous step as SSL Profile.
- Click Next.
- Under Step 2: Policies, go to the HTTP Request policies and click on the green coloured + icon to add a policy rule.
- Add the policies as shown below for host header match. Host header is the FQDN of UAG servers. As shown below, in first rule host header of uag server 1 is used and in action we have selected same server.
- Click Save rule.
- Similarly, create another rule. The rule host header of uag server2 is used in this rule and under action the same server is selected.
- Click Next.
- Click Next and save the configuration.
- Create an L4 virtual service
Create another virtual service which will share the same IP address as that of the L7 VIP. This will make sure that we need only one virtual IP address for both the primary and secondary protocols. L7 virtual service will handle the primary protocol and the tunnel whereas L4 virtual service will handle other secondary protocols.
To create an L4 virtual service,
- Click Create Virtual Service > Advanced Setup.
- In the New Virtual Service screen, click Switch to Advanced under VIP Address.
- Select the L7 virtual service that was created as the Virtual Service for VIP.
- Under Service Port > Services, click Switch to Advanced.
- Add the port numbers for the secondary protocols as shown below:
- The virtual service is configured as shown below:
- Create an L4 DataScript
To create the L4 DataScript,
- Edit the L4 virtual service which was just created.
- Navigate to Polices > DataScripts.
- Click Add DataScript.
- Click on the drop-down menu under Script to Execute and click Create DataScript.
- Under L4 Events section, add the following DataScript for L4 Request Event Script field.
avi_port = avi.vs.port() if avi_port == "4001" then avi.pool.select("L4-pool", "UAG_server1_IP", 4172) elseif avi_port == "4002" then avi.pool.select("L4-pool", "UAG_server2_IP", 4172) elseif avi_port == "5001" then avi.pool.select("L4-pool", "UAG_server1_IP", 8443) elseif avi_port == "5002" then avi.pool.select("L4-pool", "UAG_server2_IP", 8443) end
- In the DataScript pane, select the L4 pool from the Pools drop-down menu.
- Click Save.
- Click Save DataScript.
- Save the configuration.