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

Note:

VMware Integrated OpenStack does not support LBaaS v1.0.

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

Procedure

  1. Using SSH, log in to the VMware Integrated OpenStack manager.
  2. Switch to root user.
    sudo su -
  3. From the VMware Integrated OpenStack manager, use SSH to log in to the Neutron node.
  4. Switch to root user.
    sudo su -
  5. Create an exclusive router.
    neutron router-create --router_type=exclusive <router name>
  6. 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>
  7. Create the load balancer.

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

    1. 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.

    2. 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.

    3. 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.

  8. 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>
  9. 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>
  10. 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.

  11. (Optional) : Send test requests to validate your LBaaS configuration.
    1. Create a test index.html file.
    2. From the same directory, run a simple request.
      # sudo python -m SimpleHTTPServer 80
    3. Log in to the client instance.
    4. 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>