Skip to content

Configure Basic Edge Load Balancing in VMware NSX

An Edge Services Gateway allows to connect services running on Logical Switches outside of NSX based networks. I've explained the base installation from zero to the first ESG here. This post explains how to connect Web servers running on logical networks VXLAN to the outside.

nsx-load-balancing

In this example I'm running 3 nginx web servers on small Linux appliances connected to a logical switch.

  1. Open the vSphere Web Client, navigate to Network & Security > NSX Edges and double-click your Edge Services Gateway (ESG).
    nsx-edges
  2. In the ESG configuration, navigate to Mange > Load Balancer > Global Configuration and click Editnsx-esg-load-balancer-enable
  3. Select Enable Load Balancer and Logging
    nsx-esg-load-balancer-global-configuration
  4. Open Application Profiles and click + to create an application profile. An application profile is a set of parameters that describes how to handle the application.nsx-load-balancer-add-application-profile
  5. NSX comes with a preconfigured application profile for web servers. Enter a Name and select Type HTTP
    nsx-load-balancer-add-application-profile-config
  6. Navigate to Pools and click + to create pool. All virtual machines that provide the web service are pooled.
    nsx-load-balancer-pools
  7. Name the Pool, configure the algorithm to ROUND-ROBIN set the monitor to default_http_monitor and click + to add all hosts where the Webserver is running.nsx-load-balancer-configure-webserver-pool
  8. The last step where the configuration comes together is to add the configuration for the virtual server. Navigate to Virtual Servers and click +nsx-load-balancer-virtual-server
  9. Set Application Profile and Default Pool to the previously configured options. Select the IP Address from the outside interface.
    nsx-load-balancer-virtual-server-configuration

The Edge Services Gateway will now load balance HTTP requests.nsx-load-balanced-nginx

Verify Pool Status
The ESG tests the availability of internal webservers consistently. To verify that all internal nodes are available, navigate to Manage > Load Balander > Pools and click Show Pool Statistics 
nsx-load-balancer-pool-status

The pool status can be also verified with the CLI on the ESG:

NSX-edge-1-0> show service loadbalancer pool
-----------------------------------------------------------------------
Loadbalancer Pool Statistics:

POOL nginx-pool
| LB METHOD round-robin
| LB PROTOCOL L7
| Transparent disabled
| SESSION (cur, max, total) = (0, 1, 5)
| BYTES in = (2440), out = (870)
 +->POOL MEMBER: nginx-pool/web102, STATUS: UP
 | | HEALTH MONITOR = BUILT-IN, default_http_monitor:L7OK
 | | | LAST STATE CHANGE: 2016-05-08 17:01:00
 | | SESSION (cur, max, total) = (0, 1, 2)
 | | BYTES in = (976), out = (348)
 +->POOL MEMBER: nginx-pool/web103, STATUS: UP
 | | HEALTH MONITOR = BUILT-IN, default_http_monitor:L7OK
 | | | LAST STATE CHANGE: 2016-05-08 17:01:00
 | | SESSION (cur, max, total) = (0, 1, 2)
 | | BYTES in = (976), out = (348)
 +->POOL MEMBER: nginx-pool/web104, STATUS: UP
 | | HEALTH MONITOR = BUILT-IN, default_http_monitor:L7OK
 | | | LAST STATE CHANGE: 2016-05-08 17:01:00
 | | SESSION (cur, max, total) = (0, 1, 1)
 | | BYTES in = (488), out = (174)

Leave a Reply

Your email address will not be published. Required fields are marked *