|
| 1 | +.. |
| 2 | + Copyright 2023 Red Hat, Inc. All rights reserved. |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | + not use this file except in compliance with the License. You may obtain |
| 6 | + a copy of the License at |
| 7 | + |
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + |
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | + License for the specific language governing permissions and limitations |
| 14 | + under the License. |
| 15 | + |
| 16 | +=============================== |
| 17 | +Using SR-IOV Ports with Octavia |
| 18 | +=============================== |
| 19 | + |
| 20 | +Single Root I/O Virtualization (SR-IOV) can significantly reduce the latency |
| 21 | +through an Octavia Amphora based load balancer while maximizing bandwith and |
| 22 | +request rates. With Octavia Amphora load balancers, you can attach SR-IOV |
| 23 | +Virtual Functions (VF) as the VIP port and/or backend member ports. |
| 24 | + |
| 25 | +Enabling SR-IOV on Your Compute Hosts |
| 26 | +------------------------------------- |
| 27 | + |
| 28 | +To allow Octavia load balancers to use SR-IOV, you must configure nova and |
| 29 | +neutron to make SR-IOV available on at least one compute host. Please follow |
| 30 | +the `Networking Guide <https://docs.openstack.org/neutron/latest/admin/config-sriov.html>`_ to setup your compute hosts for SR-IOV. |
| 31 | + |
| 32 | +Configuring Host Aggregates, Compute and Octavia Flavors |
| 33 | +-------------------------------------------------------- |
| 34 | + |
| 35 | +Octavia hot-plugs the network ports into the Amphora as the load balancer is |
| 36 | +being provisioned. This means we need to use host aggregates and compute flavor |
| 37 | +properties to make sure the Amphora are created on SR-IOV enable compute hosts |
| 38 | +with the correct networks. |
| 39 | + |
| 40 | +Host Aggregates |
| 41 | +~~~~~~~~~~~~~~~ |
| 42 | + |
| 43 | +This configuration can be as simple or complex as you need it to be. A simple |
| 44 | +approach would be to add one property for the SR-IOV host aggregate, such as: |
| 45 | + |
| 46 | +.. code-block:: bash |
| 47 | +
|
| 48 | + $ openstack aggregate create sriov_aggregate |
| 49 | + $ openstack aggregate add host sriov_aggregate sriov-host.example.org |
| 50 | + $ openstack aggregate set --property sriov-nic=true sriov_aggregate |
| 51 | +
|
| 52 | +A more advanced configuration may list out the specific networks that are |
| 53 | +available via the SR-IOV VFs: |
| 54 | + |
| 55 | +.. code-block:: bash |
| 56 | +
|
| 57 | + $ openstack aggregate create sriov_aggregate |
| 58 | + $ openstack aggregate add host sriov_aggregate sriov-host.example.org |
| 59 | + $ openstack aggregate set --property public-sriov=true --property members-sriov=true sriov_aggregate |
| 60 | +
|
| 61 | +Compute Flavors |
| 62 | +~~~~~~~~~~~~~~~ |
| 63 | + |
| 64 | +Next we need to create a compute flavor that includes the required properties |
| 65 | +to match the host aggregate. Here is an example for a basic Octavia Amphora |
| 66 | +compute flavor using the advanced host aggregate discussed in the previous |
| 67 | +section: |
| 68 | + |
| 69 | +.. code-block:: bash |
| 70 | +
|
| 71 | + $ openstack flavor create --id amphora-sriov-flavor --ram 1024 --disk 3 --vcpus 1 --private sriov.amphora --property hw_rng:allowed=True --property public-sriov=true --property members-sriov=true |
| 72 | +
|
| 73 | +.. note:: |
| 74 | + This flavor is marked "private" so must be created inside the Octavia |
| 75 | + service account project. |
| 76 | + |
| 77 | +Octavia Flavors |
| 78 | +~~~~~~~~~~~~~~~ |
| 79 | + |
| 80 | +Now that we have the compute service setup to properly place our Amphora |
| 81 | +instances on hosts with SR-IOV NICs on the right networks, we can create an |
| 82 | +Octavia flavor that will use the compute flavor. |
| 83 | + |
| 84 | +.. code-block:: bash |
| 85 | +
|
| 86 | + $ openstack loadbalancer flavorprofile create --name amphora-sriov-profile --provider amphora --flavor-data '{"compute_flavor": "amphora-sriov-flavor", "sriov_vip": true}' |
| 87 | + $ openstack loadbalancer flavor create --name SRIOV-public-members --flavorprofile amphora-sriov-profile --description "A load balancer that uses SR-IOV for the 'public' network and 'members' network." --enable |
| 88 | +
|
| 89 | +
|
0 commit comments