Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75c1bdd

Browse files
committed
Add support for SR-IOV ports in Octavia
Change-Id: I16622add64076370dad85620043f71077bc9acbb
1 parent ffc9d83 commit 75c1bdd

38 files changed

Lines changed: 632 additions & 136 deletions

api-ref/source/parameters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,14 @@ vip_subnet_id-optional:
17931793
in: body
17941794
required: false
17951795
type: uuid
1796+
vip_vnic_type:
1797+
description: |
1798+
The VIP vNIC type used for the load balancer. One of ``normal`` or
1799+
``direct``.
1800+
in: body
1801+
required: true
1802+
type: string
1803+
min_version: 2.28
17961804
vrrp-id:
17971805
description: |
17981806
The vrrp group's ID for the amphora.

api-ref/source/v2/examples/loadbalancer-create-response.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"name": "best_load_balancer",
2222
"vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3",
2323
"availability_zone": "my_az",
24-
"tags": ["test_tag"]
24+
"tags": ["test_tag"],
25+
"vip_vnic_type": "normal"
2526
}
2627
}

api-ref/source/v2/examples/loadbalancer-full-create-response.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
"name": "best_load_balancer",
178178
"vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3",
179179
"availability_zone": "my_az",
180-
"tags": ["test_tag"]
180+
"tags": ["test_tag"],
181+
"vip_vnic_type": "normal"
181182
}
182183
}

api-ref/source/v2/examples/loadbalancer-show-response.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"name": "best_load_balancer",
1919
"vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3",
2020
"availability_zone": "my_az",
21-
"tags": []
21+
"tags": [],
22+
"vip_vnic_type": "normal"
2223
}
2324
}

api-ref/source/v2/examples/loadbalancer-update-response.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"operating_status": "ONLINE",
1818
"name": "disabled_load_balancer",
1919
"vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3",
20-
"tags": ["updated_tag"]
20+
"tags": ["updated_tag"],
21+
"vip_vnic_type": "normal"
2122
}
2223
}

api-ref/source/v2/examples/loadbalancers-list-response.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"name": "best_load_balancer",
3030
"vip_qos_policy_id": "ec4f78ca-8da8-4e99-8a1a-e3b94595a7a3",
3131
"availability_zone": "my_az",
32-
"tags": []
32+
"tags": [],
33+
"vip_vnic_type": "normal"
3334
}
3435
]
3536
}

api-ref/source/v2/loadbalancer.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Response Parameters
6767
- vip_port_id: vip_port_id
6868
- vip_qos_policy_id: vip_qos_policy_id
6969
- vip_subnet_id: vip_subnet_id
70+
- vip_vnic_type: vip_vnic_type
7071

7172
Response Example
7273
----------------
@@ -225,6 +226,7 @@ Response Parameters
225226
- vip_port_id: vip_port_id
226227
- vip_qos_policy_id: vip_qos_policy_id
227228
- vip_subnet_id: vip_subnet_id
229+
- vip_vnic_type: vip_vnic_type
228230

229231
Response Example
230232
----------------
@@ -320,6 +322,7 @@ Response Parameters
320322
- vip_port_id: vip_port_id
321323
- vip_qos_policy_id: vip_qos_policy_id
322324
- vip_subnet_id: vip_subnet_id
325+
- vip_vnic_type: vip_vnic_type
323326

324327
Response Example
325328
----------------
@@ -407,6 +410,7 @@ Response Parameters
407410
- vip_port_id: vip_port_id
408411
- vip_qos_policy_id: vip_qos_policy_id
409412
- vip_subnet_id: vip_subnet_id
413+
- vip_vnic_type: vip_vnic_type
410414

411415
Response Example
412416
----------------

doc/source/admin/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Optional Installation and Configuration Guides
3737
flavors.rst
3838
apache-httpd.rst
3939
failover-circuit-breaker.rst
40+
sr-iov.rst
4041

4142
Maintenance and Operations
4243
--------------------------

doc/source/admin/sr-iov.rst

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+

octavia/api/drivers/amphora_driver/flavor_schema.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
consts.AMP_IMAGE_TAG: {
4848
"type": "string",
4949
"description": "The amphora image tag."
50-
}
50+
},
51+
consts.SRIOV_VIP: {
52+
"type": "boolean",
53+
"description": "When true, the VIP port will be created using an "
54+
"SR-IOV VF port."
55+
},
5156
}
5257
}

0 commit comments

Comments
 (0)