Introduction to Gateway Services: Load Balancing

The gateway services within *VMware vCloud Air include multiple customizable networking options. Here, we look at how to set up load balancing to distribute traffic among all the servers in a particular pool.

Watch the video

1. Identify External IP Addresses


If you're not already logged in, to get started:

  1. Go to https://vchs.vmware.com/login and log in to vCloud Air.
  2. On the Dashboard tab, click the virtual data center where you want to add load balancing (in this example, we use the SHAREPOINT virtual data center).



  3. Click the Gateways tab, and then click Manage in vCloud Director to access the vCloud Director user interface.



    Before you set up load balancing, you need to know what external IP addresses are available.

  4. To identify available external IP addresses, click the Edge Gateways tab, select the corresponding network, and then click Properties.



  5. In the Edge Gateway Properties window, click the Sub-Allocate IP Pools tab and note the range of available IP addresses in the Sub-Allocated IP Pool box.
  • In this example, the range is .230 through .231.

6. Click OK to return to the vCloud Director Administration window.

2. Creating the Server Pool


To set up load balancing, you first need to create a new pool of servers, which will be used to sit behind the actual load balancer. There are three parts to creating a new pool of servers: configuring the settings for the server pool, configuring the health check, and then adding the servers.

Configure the Server Pool Settings

  1. On the Edge Gateways tab, select the appropriate network and click Edge Gateway Services.



  2. In the Configure Services window, click the Load Balancer tab, select Pool Servers, and then click Add.



  3. In the Add Load Balancer Member Pool - Name & Description window, enter a name and description (if desired), and then click Next.
  • In this example, we use the name Demo Pool.



4. In the Add Load Balancer Member Pool - Configure Service window, select the desired service and load balancing method, and then click Next.

  • Service: Choose HTTP, HTTPS, or TCP.
  • Balancing Method: Choose IP Hash, Round Robin, URI, or Least Connected.
  • In this example, we use HTTP and Round Robin.



    Note: The following table provides more information about load balancing methods:
Load Balancing Method Description
IP Hash Selects a server based on a hash of the source and destination IP address of each packet.
Round Robin Each server is used in turn according to the weight assigned to it. This is the smoothest and fairest algorithm when the server's processing time remains equally distributed.
URI The left part of the URI (before the question mark) is hashed and divided by the total weight of the running servers. The result designates which server will receive the request. This ensures that a URI is always directed to the same server as long as no server goes up and down.
Least Connected Distributed client requests to multiple servers based on the number of connections already on the server.

Configure the Health Check

5. In the Add Load Balancer Member Pool - Configure Health Check window, select the health check mode and monitor port (if desired), and then click Next.

  • In this example, we use HTTP as the mode for the HTTP service.
  • We leave the Monitor Port field blank because we don't want to monitor the health check.



    Note: The follwing table provides more information about the health check modes available with each service:
Service Option Description
HTTP The GET/default method is used to detect server status. Only responses 2xx and 3xx are valid. Other responses (including a lack of response) indicate a server failure.
SSL Tests servers using SSLv3 client hello messages. The server is considered valid only when the response contains server hello messages.

Add the Servers

6. In the Add Load Balancer Member Pool - Manage Members window, click Add.



7. In the Add Member window, complete the following fields, and then click OK.

  • IP Address: Provide an IP address for the server you want to add to the pool.
  • Ratio Weight: Assign a server weight, which is used for some load balancing methods.
  • Services & Monitoring: To enable monitoring, assign service and monitor ports. Here, we use 80 and 8080, respectively.




8. Repeat Steps 6-7 to add as many servers as needed, and then click Next.

  • Note that in this example, the servers are even because we left the ratio weight the same.


9. In the Add Load Balancer Member Pool - Ready to Complete window, click Finish to create the pool.

3. Creating the Load Balancer Virtual Server


With the server pool created, you now need to create a virtual server on top of that pool to act as the load balancer and connection to the external network.

  1. In the Configure Services window, click the Load Balancer tab, select Virtual Servers, and then click Add.



  2. In the Add Virtual Server window, complete the following information, and then click OK.
  • Name: Provide a name for the virtual server. In this example, we use Demo Server.
  • Applied on: Choose the network where the virtual server will be applied. Here, we apply the server on the external network because we want to access it from the outside.
  • IP address: Use an available external IP address identified above.
  • Persistence Method: Select None or Cookie.



3. In the Configure Services window, confirm that the Demo Server has been created.

4. Configure the Firewall


The final step is to configure the firewall to allow traffic to come in and accommodate load balancing.

  1. In the Configure Services window, click the Firewall tab to create a firewall rule.
  • In this instance, you want to create a new firewall rule that allows external traffic through the gateway. For example, you might configure a rule that allows traffic from port 80 to come in.