Este contenido no está disponible en el idioma seleccionado.
Chapter 6. Deploying SR-IOV technologies
Single root I/O virtualization (SR-IOV) allows near bare metal performance by allowing instances from OpenStack direct access to a shared PCIe resource through virtual resources.
6.1. Prerequisites Copiar enlaceEnlace copiado en el portapapeles!
- Install and configure the undercloud before deploying the overcloud. See the Director Installation and Usage Guide for details.
Do not manually edit values in /etc/tuned/cpu-partitioning-variables.conf
that are modified by Director heat templates.
6.2. Configuring SR-IOV Copiar enlaceEnlace copiado en el portapapeles!
The CPU assignments, memory allocation and NIC configurations of the following examples may differ from your topology and use case.
Generate the built-in
ComputeSriov
to define nodes in the OpenStack cluster that will runNeutronSriovAgent
,NeutronSriovHostConfig
and default compute services.openstack overcloud roles generate \ -o /home/stack/templates/roles_data.yaml \ Controller ComputeSriov
# openstack overcloud roles generate \ -o /home/stack/templates/roles_data.yaml \ Controller ComputeSriov
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Include the
neutron-sriov.yaml
androles_data.yaml
files when generatingovercloud_images.yaml
so that SR-IOV containers are prepared.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe push-destination IP address is the address that you previously set with the
local_ip
parameter in theundercloud.conf
configuration file.For more information on container image preparation, see Director Installation and Usage.
To apply the
KernelAgs
andTunedProfile
parameters, include thehost-config-and-reboot.yaml
file from/usr/share/openstack-tripleo-heat-templates/environments
to your deployment script.openstack overcloud deploy --templates \ … \ -e /usr/share/openstack-tripleo-heat-templates/environments/host-config-and-reboot.yaml \ ...
openstack overcloud deploy --templates \ … \ -e /usr/share/openstack-tripleo-heat-templates/environments/host-config-and-reboot.yaml \ ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the parameters for the SR-IOV nodes under
parameter_defaults
in accordance with the needs of your cluster, and the configuration of your hardware. These settings are typically added to thenetwork-environment.yaml
file.NeutronNetworkType: 'vlan' NeutronNetworkVLANRanges: - tenant:22:22 - tenant:25:25 NeutronTunnelTypes: ''
NeutronNetworkType: 'vlan' NeutronNetworkVLANRanges: - tenant:22:22 - tenant:25:25 NeutronTunnelTypes: ''
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the same file, configure role specific parameters for SR-IOV compute nodes.
NoteThe
NeutronSriovNumVFs
parameter will soon be deprecated in favor of thenumvfs
attribute in the network configuration templates. Red Hat does not support modification of theNeutronSriovNumVFs
parameter, nor thenumvfs
parameter, after deployment. Changing either parameter within a running environment is known to cause a permanent outage for all running instances which have an SR-IOV port on that PF. Unless you hard reboot these instances, the SR-IOV PCI device will not be visible to the instance.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the SR-IOV enabled interfaces in the
compute.yaml
network configuration template. Ensure the interfaces are configured as standalone NICs for the purposes of creating SR-IOV virtual functions (VFs):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the list of default filters includes the value
AggregateInstanceExtraSpecsFilter
.NovaSchedulerDefaultFilters: ['AvailabilityZoneFilter','RamFilter','ComputeFilter','ComputeCapabilitiesFilter','ImagePropertiesFilter','ServerGroupAntiAffinityFilter','ServerGroupAffinityFilter','PciPassthroughFilter','AggregateInstanceExtraSpecsFilter']
NovaSchedulerDefaultFilters: ['AvailabilityZoneFilter','RamFilter','ComputeFilter','ComputeCapabilitiesFilter','ImagePropertiesFilter','ServerGroupAntiAffinityFilter','ServerGroupAffinityFilter','PciPassthroughFilter','AggregateInstanceExtraSpecsFilter']
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Deploy the overcloud.
6.3. Configuring Hardware Offload (Technology Preview) Copiar enlaceEnlace copiado en el portapapeles!
Open vSwitch (OVS) hardware offload is a technology preview and not recommended for production deployments. For more information about technology preview features, see Scope of Coverage Details.
OVS hardware offload takes advantage of single root I/O virtualization (SR-IOV), therefore some of the same configuration steps apply.
6.3.1. Open vSwitch hardware offload Copiar enlaceEnlace copiado en el portapapeles!
To enable OVS hardware offload, complete the following steps.
Procedure
Generate the
ComputeSriov
role:openstack overcloud roles generate -o roles_data.yaml Controller ComputeSriov
openstack overcloud roles generate -o roles_data.yaml Controller ComputeSriov
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the
physical_network
parameter to match your environment.-
For VLAN, set the
physical_network
parameter to the name of the network you create in neutron after deployment. This value should also be inNeutronBridgeMappings
. -
For VXLAN, set the
physical_network
parameter to the string valuenull
. Ensure the
OvsHwOffload
parameter under role specific parameters has a value oftrue
.Example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
For VLAN, set the
Ensure that the list of default filters includes the value
NUMATopologyFilter
:NovaSchedulerDefaultFilters: ['RetryFilter','AvailabilityZoneFilter','ComputeFilter','ComputeCapabilitiesFilter','ImagePropertiesFilter','ServerGroupAntiAffinityFilter','ServerGroupAffinityFilter','PciPassthroughFilter','NUMATopologyFilter']
NovaSchedulerDefaultFilters: ['RetryFilter','AvailabilityZoneFilter','ComputeFilter','ComputeCapabilitiesFilter','ImagePropertiesFilter','ServerGroupAntiAffinityFilter','ServerGroupAffinityFilter','PciPassthroughFilter','NUMATopologyFilter']
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure one or more network interfaces intended for hardware offload in the
compute-sriov.yaml
configuration file:NoteDo not use the
NeutronSriovNumVFs
parameter when configuring Open vSwitch hardware offload. The number of virtual functions will be specified using thenumvfs
parameter in a network configuration file used byos-net-config
. Red Hat does not support modifying thenumvfs
setting during update or redeployment.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteDo not configure Mellanox network interfaces as a nic-config interface type
ovs-vlan
because this prevents tunnel endpoints such as VXLAN from passing traffic due to driver limitations.Include the following files during the deployment of the overcloud:
- ovs-hw-offload.yaml
host-config-and-reboot.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3.2. Verification Copiar enlaceEnlace copiado en el portapapeles!
Confirm that a pci device has its mode configured as switchdev:
devlink dev eswitch show pci/0000:03:00.0
# devlink dev eswitch show pci/0000:03:00.0 pci/0000:03:00.0: mode switchdev inline-mode none encap enable
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm offload is enabled in OVS:
ovs-vsctl get Open_vSwitch . other_config:hw-offload
# ovs-vsctl get Open_vSwitch . other_config:hw-offload "true"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm hardware offload is enabled on the NIC:
ethtool -k $NIC | grep tc-offload
# ethtool -k $NIC | grep tc-offload hw-tc-offload: on
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Deploying an instance for SR-IOV Copiar enlaceEnlace copiado en el portapapeles!
It is recommended to use host aggregates to separate high performance compute hosts. For information on creating host aggregates and associated flavors for scheduling see Creating host aggregates.
You should use host aggregates to separate CPU pinned instances from unpinned instances. Instances that do not use CPU pinning do not respect the resourcing requirements of instances that use CPU pinning.
Deploy an instance for single root I/O virtualization (SR-IOV) by performing the following steps:
Create a flavor.
openstack flavor create <flavor> --ram <MB> --disk <GB> --vcpus <#>
# openstack flavor create <flavor> --ram <MB> --disk <GB> --vcpus <#>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the network.
openstack network create net1 --provider-physical-network tenant --provider-network-type vlan --provider-segment <VLAN-ID>
openstack network create net1 --provider-physical-network tenant --provider-network-type vlan --provider-segment <VLAN-ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the port.
Use vnic-type
direct
to create an SR-IOV virtual function (VF) port.openstack port create --network net1 --vnic-type direct sriov_port
# openstack port create --network net1 --vnic-type direct sriov_port
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the following to create a virtual function with hardware offload.
openstack port create --network net1 --vnic-type direct --binding-profile '{"capabilities": ["switchdev"]} sriov_hwoffload_port
openstack port create --network net1 --vnic-type direct --binding-profile '{"capabilities": ["switchdev"]} sriov_hwoffload_port
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use vnic-type
direct-physical
to create an SR-IOV PF port.openstack port create --network net1 --vnic-type direct-physical sriov_port
# openstack port create --network net1 --vnic-type direct-physical sriov_port
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Deploy an instance
openstack server create --flavor <flavor> --image <image> --nic port-id=<id> <instance name>
# openstack server create --flavor <flavor> --image <image> --nic port-id=<id> <instance name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.5. Creating host aggregates Copiar enlaceEnlace copiado en el portapapeles!
It is recommended to deploy guests using cpu pinning and hugepages for increased performance. You can schedule high performance instances on a subset of hosts by matching aggregate metadata with flavor metadata.
6.5.1. Procedure Copiar enlaceEnlace copiado en el portapapeles!
Ensure that the
AggregateInstanceExtraSpecsFilter
value is included in thescheduler_default_filters
parameter in thenova.conf
configuration file. This configuration can be set through the heat parameterNovaSchedulerDefaultFilters
under role-specific parameters before deployment.ComputeOvsDpdkSriovParameters: NovaSchedulerDefaultFilters: ['AggregateInstanceExtraSpecsFilter', 'RetryFilter','AvailabilityZoneFilter','RamFilter','ComputeFilter','ComputeCapabilitiesFilter','ImagePropertiesFilter','ServerGroupAntiAffinityFilter','ServerGroupAffinityFilter','PciPassthroughFilter','NUMATopologyFilter']
ComputeOvsDpdkSriovParameters: NovaSchedulerDefaultFilters: ['AggregateInstanceExtraSpecsFilter', 'RetryFilter','AvailabilityZoneFilter','RamFilter','ComputeFilter','ComputeCapabilitiesFilter','ImagePropertiesFilter','ServerGroupAntiAffinityFilter','ServerGroupAffinityFilter','PciPassthroughFilter','NUMATopologyFilter']
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis parameter can be added to heat templates and the original deployment script re-run to add this to the configuration of an exiting cluster.
Create an aggregate group for single root I/O virtualization (SR-IOV), and add relevant hosts. Define metadata, for example,
sriov=true
, that matches defined flavor metadata.openstack aggregate create sriov_group openstack aggregate add host sriov_group compute-sriov-0.localdomain openstack aggregate set sriov_group sriov=true
# openstack aggregate create sriov_group # openstack aggregate add host sriov_group compute-sriov-0.localdomain # openstack aggregate set sriov_group sriov=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a flavor.
openstack flavor create <flavor> --ram <MB> --disk <GB> --vcpus <#>
# openstack flavor create <flavor> --ram <MB> --disk <GB> --vcpus <#>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set additional flavor properties. Note that the defined metadata,
sriov=true
, matches the defined metadata on the SR-IOV aggregate.openstack flavor set --property sriov=true --property hw:cpu_policy=dedicated --property hw:mem_page_size=1GB <flavor>
openstack flavor set --property sriov=true --property hw:cpu_policy=dedicated --property hw:mem_page_size=1GB <flavor>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow