VMware Integrated OpenStack 2.5 supports LBaaS v2.0. You enable LBaaS v2.0 after you complete the VMware Integrated OpenStack installation or upgrade process.

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.

This task applies only to VMware Integrated OpenStack deployed with NSX.

1

Using SSH, log in to the VMware Integrated OpenStack manager.

2

Switch to root user.

sudo su -
3

Enable LBaaS v2.0.

viocli lbaasv2-enable 

Option

Description

-d DEPLOYMENT

Indicates the name of the VMware Integrated OpenStack deployment.

4

From the VMware Integrated OpenStack manager, use SSH to log in to the Neutron node.

5

Switch to root user.

sudo su -
6

Create an exclusive router.

neutron router-create --router_type=exclusive <router name>
7

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>
8

Create the load balancer.

This step includes creating the load balancer, creating the listener, and creating the load balancer pool.

a

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.

b

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.

c

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.

9

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>
10

Add the server instances to the LBaaS pool that you created in Step 9.

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>
11

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.

12

(Optional) Send test requests to validate your LBaaS configuration.

a

Create a test index.html file.

b

From the same directory, run a simple request.

# sudo python -m SimpleHTTPServer 80
c

Log in to the client instance.

d

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>