Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 8. Load balancing network traffic at the edge
You can create load balancers at your edge sites to increase traffic throughput and reduce latency by using the Red Hat OpenStack Platform (RHOSP) Load-balancing service (octavia).
The topics included in this section are:
8.1. Creating network resources for Load-balancing service availability zones Copier lienLien copié sur presse-papiers!
Before you can create Red Hat OpenStack Platform (RHOSP) Load-balancing service (octavia) availability zones (AZs), you must be a RHOSP administrator and run the Ansible playbook, octavia-dcn-deployment.yaml.
By running octavia-dcn-deployment.yaml you create networking resources like networks, subnets, and routers, that are required for the Load-balancing service AZs. You supply the playbook with a configuration input file, octavia-dcn-parameters.yaml, in which you have specified the AZ names and the management networks that each AZ uses.
After you have run the playbook and created the necessary networking resources, you must create the actual RHOSP Load-balancing service AZs, before project (tenant) users can create load balancers in the AZs that are appropriate for their distributed compute node (DCN) locales.
This procedure demonstrates creating the required network resources for 3 Load-balancing service AZs named: az-central, az-dcn1, and az-dcn2. These Load-balancing service AZ names match the names of the Compute service AZs, and are also the names of the 3 DCNs that are used in this deployment.
Prerequisites
- You must have one Compute service (nova) AZ for every Load-balancing service AZ that you want to create.
- You must also have one Networking service (neutron) AZ for every Load-balancing service AZ that you want to create. These Networking service AZs must match the names of the Compute service AZs.
- Your Load-balancing service provider driver must be amphora. The OVN provider driver does not support AZs.
-
You must be a RHOSP user with the
adminrole.
Procedure
Source your credentials file.
- Example
source ~/centralrc
$ source ~/centralrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a file,
octavia-dcn-parameters.yaml, and using the syntax shown below, add the Load-balancing service AZs and their management networks for which you want the Ansible playbook to create the required networking resources.The value,
octavia_controller_AZ_name, is the name of the AZ in which all of the Load-balancer services run:Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantThe names of the Load-balancing service AZs that you specify must match the names of the pre-existing Compute service AZs. You can obtain the names of the Compute service AZs by running
openstack availability zone list --compute.The Ansible playbook creates a network, subnet, and router for each AZ, and names them using the AZ names that you specify in
octavia-dcn-parameters.yamlfollowing this convention:lb-mgmt-<AZ_name>-net,lb-mgmt-<AZ_name>-subnet, andlb-mgmt-<AZ_name>-router, respectively. The exception is for the network resources foroctavia_controller_AZ_name: the playbook uses the existing load-balancing management network and subnet,lb-mgmt-netandlb-mgmt-subnet, respectively, and creates an associated router that it names,lb-mgmt-router.In this example, 3 AZs are specified:
az-central,az-dcn1, andaz-dcn2. Theaz-centralAZ uses the existing load-balancing management network,lb-mgmt-net. The other two AZs use172.47.0.0/16and172.48.0.0/16, respectively:- Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the Ansible playbook,
octavia-dcn-deployment.yaml, and include the AZ definitions that you created inoctavia-dcn-parameters.yaml:- Example
ansible-playbook -i overcloud-deploy/central/config-download/\ central/tripleo-ansible-inventory.yaml \ /usr/share/ansible/tripleo-playbooks/octavia-dcn-deployment.yaml \ -e @octavia-dcn-parameters.yaml -e stack=central -v
$ ansible-playbook -i overcloud-deploy/central/config-download/\ central/tripleo-ansible-inventory.yaml \ /usr/share/ansible/tripleo-playbooks/octavia-dcn-deployment.yaml \ -e @octavia-dcn-parameters.yaml -e stack=central -vCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Confirm that the required
lb-mgmt-*subnets are present.openstack subnet list -c Name -c Subnet
$ openstack subnet list -c Name -c SubnetCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Confirm that the required virtual routers are present.
openstack router list -c Name -c Status
$ openstack router list -c Name -c StatusCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
8.2. Creating availability zones for the Load-balancing service Copier lienLien copié sur presse-papiers!
With the Red Hat OpenStack Platform (RHOSP) Load-balancing service (octavia), RHOSP administrators can create availability zones (AZs) that enable project users to create load balancers in a distributed compute node (DCN) environment to increase traffic throughput and reduce latency.
There are two steps required to create a Load-balancing service AZ: RHOSP administrators must first create an AZ profile, and then use the profile to create a Load-balancing service AZ that is visible to users.
An AZ profile must have the following:
- The name of the Compute service (nova) AZ.
The management network to use.
There are multiple management networks, one unique network for each AZ. The central AZ uses the existing load-balancing management network,
lb-mgmt-net, and the additional AZs use their respective network,lb-mgmt-<AZ_name>-net, for example,lb-mgmt-az-dcn1-net,lb-mgmt-az-dcn2-net, and so on.
Prerequisites
You must have a DCN environment in which the required networking resources have been created by running the
octavia-dcn-deployment.yamlAnsible playbook.For more information, see Creating network resources for Load-balancing service availability zones.
- Your Load-balancing service provider driver must be amphora. The OVN provider driver does not support AZs.
-
You must be a RHOSP user with the
adminrole.
Procedure
Source your credentials file.
- Example
source ~/centralrc
$ source ~/centralrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Gather the names of the Compute service AZs that you will use to name your Load-balancing service AZs.
ImportantThe names of the Load-balancing service AZ that you create must match the names of your Compute service AZs.
openstack availability zone list --compute
$ openstack availability zone list --computeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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
$ openstack network list -c Name -c IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create an AZ profile. Repeat this step to create an AZ profile for each Load-balancing service AZ that you want to create:
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>"}'$ 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>"}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Example - create profile for
az-central In this example, an AZ profile (
az_profile_central) is created that uses the management network (lb-mgmt-net) on a Compute node that runs in the Compute AZ (az-central):openstack loadbalancer availabilityzoneprofile create \ --name az_profile_central --provider amphora --availability-zone-data \ '{"compute_zone": "az-central","management_network": \ "662a94f5-51eb-4a4c-86c4-52dcbf471ef9"}'$ openstack loadbalancer availabilityzoneprofile create \ --name az_profile_central --provider amphora --availability-zone-data \ '{"compute_zone": "az-central","management_network": \ "662a94f5-51eb-4a4c-86c4-52dcbf471ef9"}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Example - create profile for
Repeat step 4 to create an AZ profile for each Load-balancing service AZ that you want to create.
- Example - create profile for
az-dcn1 In this example, an AZ profile (
az-profile-dcn1) is created that uses the management network (lb-mgmt-az-dcn1-net) on a Compute node that runs in the Compute AZ (az-dcn1):openstack loadbalancer availabilityzoneprofile create \ --name az-profile-dcn1 --provider amphora --availability-zone-data \ '{"compute-zone": "az-dcn1","management-network": \ "a2884aaf-846c-4936-9982-3083f6a71d9b"}'$ openstack loadbalancer availabilityzoneprofile create \ --name az-profile-dcn1 --provider amphora --availability-zone-data \ '{"compute-zone": "az-dcn1","management-network": \ "a2884aaf-846c-4936-9982-3083f6a71d9b"}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Example - create profile for
az-dcn2 In this example, an AZ profile (
az-profile-dcn2) is created that uses the management network (lb-mgmt-az-dcn2-net) on a Compute node that runs in the Compute AZ (az-dcn2):openstack loadbalancer availabilityzoneprofile create \ --name az-profile-dcn2 --provider amphora --availability-zone-data \ '{"compute-zone": "az-dcn2","management-network": \ "10458d6b-e7c9-436f-92d9-711677c9d9fd"}'$ openstack loadbalancer availabilityzoneprofile create \ --name az-profile-dcn2 --provider amphora --availability-zone-data \ '{"compute-zone": "az-dcn2","management-network": \ "10458d6b-e7c9-436f-92d9-711677c9d9fd"}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Example - create profile for
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: az-central
In this example, a Load-balancing service AZ (
az-central) is created by using the AZ profile (az-profile-central):openstack loadbalancer availabilityzone create --name az-central \ --availabilityzoneprofile az-profile-central \ --description "AZ for Headquarters" --enable
$ openstack loadbalancer availabilityzone create --name az-central \ --availabilityzoneprofile az-profile-central \ --description "AZ for Headquarters" --enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Example - create AZ: az-dcn1
In this example, a Load-balancing service AZ (
az-dcn1) is created by using the AZ profile (az-profile-az-dcn1):openstack loadbalancer availabilityzone create --name az-dcn1 \ --availabilityzoneprofile az-profile-az-dcn1 \ --description "AZ for South Region" --enable
$ openstack loadbalancer availabilityzone create --name az-dcn1 \ --availabilityzoneprofile az-profile-az-dcn1 \ --description "AZ for South Region" --enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Example - create AZ: az-dcn2
In this example, a Load-balancing service AZ (
az-dcn2) is created by using the AZ profile (az-profile-az-dcn2):openstack loadbalancer availabilityzone create --name az-dcn2 \ --availabilityzoneprofile az-profile-az-dcn2 \ --description "AZ for North Region" --enable
$ openstack loadbalancer availabilityzone create --name az-dcn2 \ --availabilityzoneprofile az-profile-az-dcn2 \ --description "AZ for North Region" --enableCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Confirm that the AZ (
az-central) was created. Repeat this step for any additional AZs, using the appropriate name for each AZ.- Example - verify az-central
openstack loadbalancer availabilityzone show az-central
$ openstack loadbalancer availabilityzone show az-centralCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Example - verify az-dcn1
openstack loadbalancer availabilityzone show az-dcn1
$ openstack loadbalancer availabilityzone show az-dcn1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Example - verify az-dcn2
openstack loadbalancer availabilityzone show az-dcn2
$ openstack loadbalancer availabilityzone show az-dcn2Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.3. Creating load balancers in availability zones Copier lienLien copié sur presse-papiers!
With the Red Hat OpenStack Platform (RHOSP) Load-balancing service (octavia), you can create load balancers in availability zones (AZs) in a distributed compute node (DCN) environment to increase traffic throughput and reduce latency.
Prerequisites
- You must have a Load-balancing service AZ provided by your RHOSP 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
Source your credentials file.
Example::*
source ~/centralrc
$ source ~/centralrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow To create a load balancer for a DCN environment, use the
loadbalancer createcommand with the--availability-zoneoption and specify the appropriate AZ.- Example
For example, to create a non-terminated HTTPS load balancer (
lb1) on a public subnet (public_subnet) on availability zone (az-central), you would enter the following command:openstack loadbalancer create --name lb1 --vip-subnet-id \ public_subnet --availability-zone az-central
$ openstack loadbalancer create --name lb1 --vip-subnet-id \ public_subnet --availability-zone az-centralCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Continue to create your load balancer by adding a listener, pool, health monitor, and load balancer members.
For more information, see the Configuring load balancing as a service guide.
Verification
Confirm that the load balancer (lb1) is a member of the availability zone (
az-central).Example::*
openstack loadbalancer show lb1
$ openstack loadbalancer show lb1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow