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.
In this example I'm running 3 nginx web servers on small Linux appliances connected to a logical switch.
- Open the vSphere Web Client, navigate to Network & Security > NSX Edges and double-click your Edge Services Gateway (ESG).
- In the ESG configuration, navigate to Mange > Load Balancer > Global Configuration and click Edit
- Select Enable Load Balancer and Logging
- 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 comes with a preconfigured application profile for web servers. Enter a Name and select Type HTTP
- Navigate to Pools and click + to create pool. All virtual machines that provide the web service are pooled.
- 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.
- The last step where the configuration comes together is to add the configuration for the virtual server. Navigate to Virtual Servers and click +
- Set Application Profile and Default Pool to the previously configured options. Select the IP Address from the outside interface.
The Edge Services Gateway will now load balance HTTP requests.
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
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)