Set up load balancer availability zones

In Red Hat OpenStack Services on OpenShift (RHOSO), Load-balancing service (octavia) availability zones (AZs) enable project users to create load balancers to increase traffic throughput and reduce latency. Load-balancing AZs are often used on distributed compute node (DCN) and edge environments.

Create availability zones for load balancing

There are two steps required to create a Load-balancing service AZ: RHOSO administrators must first create a load-balancer AZ profile, and then use the profile to create a Load-balancing service AZ that is visible to users.

Before you begin

  • You have the oc command line tool installed on your workstation.
  • You are logged on to a workstation that has access to the RHOSO control plane as a user with cluster-admin privileges.
  • The load balancer created with the AZ must use the amphora load-balancing provider.

    The OVN load-balancing provider uses another mechanism to support availability zones that is native to OVN.

  • You must have a DCN environment in which the required networking resources have been created by running the octavia-dcn-deployment.yaml Ansible Playbook.
  • You have access to a Compute service (nova) AZ.
  • Your site has access to a management network. You have two options:
    • A "stretched" Layer 2 load-balancing management network.
    • A distributed Compute node (DCN) environment where you want to isolate your networks.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. Gather the names of the Compute service AZs that you will use for your Load-balancing service AZs.
    Tip

    Naming your Load-balancing service AZs to match the names of your Compute service AZs can facilitate AZ management.

    $ openstack availability zone list --compute
    Sample output
    +-----------+-------------+
    | Zone Name | Zone Status |
    +-----------+-------------+
    | az0       | available   |
    | az1       | available   |
    | az2       | available   |
    | internal  | available   |
    +-----------+-------------+
  3. Gather the IDs for the management networks that you will use to create your Load-balancing service AZs:
    $ openstack network list -c Name -c ID
    Sample output
    +--------------------------------------+----------------------+
    | ID                                   | Name                 |
    +--------------------------------------+----------------------+
    | 0947ddcf-d9be-4b8c-94a1-be3852e5d905 | dcn2-public          |
    | 4f35cb1c-69d7-4582-b3a5-0cf380c56f62 | dcn1-public          |
    | 55e761de-ef4c-4a5c-8198-89d20a06eca3 | lb-mgmt-az2-net      |
    | a1894c48-823c-4def-bb6f-e9b7ec4d0c0a | public               |
    | bf72ef9b-e0f1-4d4e-a8b5-7f5bb036a275 | lb-mgmt-az1-net      |
    | ff8f3153-a74b-499c-a850-947ad199fc6d | octavia-provider-net |
    +--------------------------------------+----------------------+
    Note

    Ensure that you know which networks are valid for creating VIPs for your site.

  4. Create an AZ profile:
    $ openstack loadbalancer availabilityzoneprofile create \
    --name <AZ_profile_name> --provider amphora --availability-zone-data \
    '{"compute_zone": "<compute_AZ_name>","management_network": \
    "<lb_mgmt_AZ_net_UUID>", "valid_vip_networks": ["<valid_AZ_VIP_net_UUID>"]}'
    • Replace <AZ_profile_name> with the name of the AZ profile that you are creating.
    • Replace <compute_AZ_name> with the name of the Compute AZ where you are creating the AZ profile.
    • Replace <lb_mgmt_AZ_net_UUID> with the ID of the management network available to the AZ that will be created.
    • (Optional) replace <valid_AZ_VIP_net_UUID> with the network ID that is allowed for VIP use. Use valid_vip_networks if you want to restrict the networks available for VIPs in this AZ.
      Example - create profile for az0

      In this example, an AZ profile (az0_profile) is created that uses the management network (lb-mgmt-net) on a Compute node that runs in the Compute AZ (az0):

      $ openstack loadbalancer availabilityzoneprofile create \
      --name az0_profile --provider amphora --availability-zone-data \
      '{"compute_zone": "az0","management_network": \
      "662a94f5-51eb-4a4c-86c4-52dcbf471ef9"}'
  5. Repeat step 4 to create an AZ profile for each Load-balancing service AZ that you want to create.
    Example - create profile for az1

    In this example, an AZ profile (az1-profile) is created that uses the management network (lb-mgmt-az1-net) on a Compute node that runs in the Compute AZ (az1):

    $ openstack loadbalancer availabilityzoneprofile create \
    --name az1-profile --provider amphora --availability-zone-data \
    '{"compute-zone": "az1","management-network": \
    "a2884aaf-846c-4936-9982-3083f6a71d9b"}'
    Example - create profile for az2

    In this example, an AZ profile (az2-profile) is created that uses the management network (lb-mgmt-az2-net) on a Compute node that runs in the Compute AZ (az2):

    $ openstack loadbalancer availabilityzoneprofile create \
    --name az2-profile --provider amphora --availability-zone-data \
    '{"compute-zone": "az2","management-network": \
    "10458d6b-e7c9-436f-92d9-711677c9d9fd"}'
  6. Using the AZ profile, create a Load-balancing service AZ. Repeat this step for any additional AZs, using the appropriate profile for each AZ.
    Example - create AZ: az0

    In this example, a Load-balancing service AZ (az0) is created by using the AZ profile (az0-profile):

    $ openstack loadbalancer availabilityzone create --name az0 \
    --availabilityzoneprofile az0-profile \
    --description "AZ for Headquarters" --enable
    Example - create AZ: az1

    In this example, a Load-balancing service AZ (az1) is created by using the AZ profile (az1-profile):

    $ openstack loadbalancer availabilityzone create --name az1 \
    --availabilityzoneprofile az1-profile \
    --description "AZ for South Region" --enable
    Example - create AZ: az2

    In this example, a Load-balancing service AZ (az2) is created by using the AZ profile (az2-profile):

    $ openstack loadbalancer availabilityzone create --name az2 \
    --availabilityzoneprofile az2-profile \
    --description "AZ for North Region" --enable

Results

  • Confirm that the AZ (az0) was created. Repeat this step for any additional AZs, using the appropriate name for each AZ.
    Example - verify az0
    $ openstack loadbalancer availabilityzone show az0
    Sample output
    +------------------------------+--------------------------------------+
    | Field                        | Value                                |
    +------------------------------+--------------------------------------+
    | name                         | az0                                  |
    | availability_zone_profile_id | 5ed25d22-52a5-48ad-85ec-255910791623 |
    | enabled                      | True                                 |
    | description                  | AZ for Headquarters                  |
    +------------------------------+--------------------------------------+
    Example - verify az1
    $ openstack loadbalancer availabilityzone show az1
    Sample output
    +------------------------------+--------------------------------------+
    | Field                        | Value                                |
    +------------------------------+--------------------------------------+
    | name                         | az1                                  |
    | availability_zone_profile_id | e0995a82-8e67-4cea-b32c-256cd61f9cf3 |
    | enabled                      | True                                 |
    | description                  | AZ for South Region                  |
    +------------------------------+--------------------------------------+
    Example - verify az2
    $ openstack loadbalancer availabilityzone show az2
    Sample output
    +------------------------------+--------------------------------------+
    | Field                        | Value                                |
    +------------------------------+--------------------------------------+
    | name                         | az2                                  |
    | availability_zone_profile_id | 306a4725-7dac-4046-8f16-f2e668ee5a8d |
    | enabled                      | True                                 |
    | description                  | AZ for North Region                  |
    +------------------------------+--------------------------------------+

What to do next

Create load balancers in availability zones

With the Red Hat OpenStack Services on OpenShift (RHOSO) Load-balancing service (octavia), you can create load balancers in availability zones (AZs) to increase traffic throughput and reduce latency. Common use cases for load-balancing AZs are distributed compute node (DCN) and edge environments.

Before you begin

  • You must have a Load-balancing service AZ provided by your administrator.
  • The virtual IP (VIP) network associated with the load balancer must be available in the AZ in which your load balancer is a member.

Procedure

  1. Confirm that the system OS_CLOUD variable is set for your cloud:
    $ echo $OS_CLOUD
    my_cloud

    Reset the variable if necessary:

    $ export OS_CLOUD=my_other_cloud

    As an alternative, you can specify the cloud name by adding the --os-cloud <cloud_name> option each time you run an openstack command.

  2. To create a load balancer for a DCN environment, use the loadbalancer create command with the --availability-zone option and specify the appropriate AZ.
    Example

    For example, to create load balancer (lb1) on a public subnet (public_subnet) on availability zone (az1), you would enter the following command:

    $ openstack loadbalancer create --name lb1 --vip-subnet-id \
    public_subnet --availability-zone az1 --wait
  3. Continue to create your load balancer by adding a listener, pool, health monitor, and load-balancer members.

Results

  • Confirm that the load balancer (lb1) is a member of the availability zone (az1).
    Example
    $ openstack loadbalancer show lb1
    Sample output
    +---------------------+--------------------------------------+
    | Field               | Value                                |
    +---------------------+--------------------------------------+
    | admin_state_up      | True                                 |
    | availability_zone   | az1                                  |
    | created_at          | 2024-07-12T16:35:05                  |
    | description         |                                      |
    | flavor_id           | None                                 |
    | id                  | 85c7e567-a0a7-4fcb-af89-a0bbc9abe3aa |
    | listeners           |                                      |
    | name                | lb1                                  |
    | operating_status    | ONLINE                               |
    | pools               |                                      |
    | project_id          | d303d3bda9b34d73926dc46f4d0cb4bc     |
    | provider            | amphora                              |
    | provisioning_status | ACTIVE                               |
    | updated_at          | 2024-07-12T16:36:45                  |
    | vip_address         | 192.0.2.229                          |
    | vip_network_id      | d7f7de6c-0e84-49e2-9042-697fa85d2532 |
    | vip_port_id         | 7f916764-d171-4317-9c86-a1750a54b16e |
    | vip_qos_policy_id   | None                                 |
    | vip_subnet_id       | a421cbcf-c5db-4323-b7ab-1df20ee6acab |
    | tags                |                                      |
    +---------------------+--------------------------------------+