VMware Integrated OpenStack 4.0 supports LBaaS v2.0. By default, you enable LBaaS v2.0 after you complete the VMware Integrated OpenStack installation or upgrade process.
About this task
This task includes creating a health monitor and associates it with the LBaaS pool that contains the LBaaS server instances. The health monitor is a Neutron service that checks if the instances are still running on the specified protocol-port.
Prerequisites
VMware Integrated OpenStack does not support LBaaS v1.0.
This task applies only to VMware Integrated OpenStack deployed with NSX.
Procedure
- Using SSH, log in to the VMware Integrated OpenStack manager.
- Switch to root user.
sudo su -
- From the VMware Integrated OpenStack manager, use SSH to log in to the Neutron node.
- Switch to root user.
sudo su -
- Create an exclusive router.
neutron router-create --router_type=exclusive <router name>
- Attach a subnet to the new router.
neutron net-create <network name> neutron subnet-create <network name> <CIDR value> --name <subnet name> neutron router-interface-add <router name or id> <subnet name or id>
- Create the load balancer.
This step includes creating the load balancer, creating the listener, and creating the load balancer pool.
- Create the load balancer, specifying the load balancing VIP subnet.
neutron lbaas-loadbalancer-create --name LOAD_BALANCER_1_NAME <vip-subnet-id>
Parameter
Description
name
Provide a name for the new load balancer.
vip-subnet-id
Specify the VIP subnet for the new load balancer. Only members on this subnet can be added to the pool.
- Create a listener for the new load balancer.
neutron lbaas-listener-create \ --loadbalancer LOAD_BALANCER_1_NAME \ --protocol <protocol type> \ --protocol-port <protocol port> --name LISTENER_1_NAME
Parameter
Description
loadbalancer
Specify the load balancer you created in the preceding substep.
protocol type
Specify the protocol type for the listener.
TCP
HTTP
HTTPS
protocol port
Specify the protocol port.
name
Provide a name for the new listener.
- Create an LBaaS pool.
neutron lbaas-pool-create \ --lb-algorithm <load balancing method> \ --listener LISTENER_1_NAME \ --protocol <protocol type> \ --name LB_POOL_1
Parameter
Description
lb-algorithm
Specify a load balancing method:
IP_HASH
Selects a server based on a hash of the source and destination IP address of each packet.
LEAST_CONN
Distributes client requests to multiple servers based on the number of connections already on the server. New connections are sent to the server with the fewest connections.
ROUND_ROBIN
Each server is used in turn according to the weight assigned to it. This process 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 receives the request, ensuring that a request is always directed to the same server as long as all servers remain available.
listener
Specify the listener you created in the preceding substep.
protocol
Specify the protocol for members of the pool to use.
TCP
HTTP
HTTPS
name
Provide a name for the new pool.
- Create the load balancer, specifying the load balancing VIP subnet.
- Create the instances for the servers and client.
nova boot --image <image-uuid> --flavor <flavor> <server 1 name> nova boot --image <image-uuid> --flavor <flavor> <server 2 name> nova boot --image <image-uuid> --flavor 1 <client name>
- Add the server instances to the LBaaS pool that you created.
neutron lbaas-member-create \ --subnet <subnet-id> --address <server 1 IP> \ --protocol-port 80 <pool name> neutron lbaas-member-create \ --subnet <subnet-id> --address <server 2 IP> \ --protocol-port 80 <pool name>
- Set up the health monitor.
neutron lbaas-healthmonitor-create \ --delay DELAY_IN_SECONDS --type [HTTP | TCP] --max-retries NUMBER \ --timeout TIMEOUT_IN_SECONDS --pool LBAAS_POOL
Parameter
Description
delay
Time in seconds between sending probes to members.
type
One of the predefined health monitor types. Specify HTTP or TCP.
max-retries
Number of permissible connection failures before changing the member status to INACTIVE.
timeout
Maximum number of seconds for a monitor to wait for a connection to be established before it times out.
Note:The timeout value must be less than the delay value.
pool
Specify the LBaaS pool to be monitored.
- (Optional) Send test requests to validate your LBaaS configuration.
- Create a test index.html file.
- From the same directory, run a simple request.
# sudo python -m SimpleHTTPServer 80
- Log in to the client instance.
- Run the wget command to view whether your requests are being correctly load-balanced across the two servers in the pool.
# wget -O - http://<vip-ip>