Chapter 8. Configuring an OVS-DPDK deployment
This section describes how to deploy DPDK with Open vSwitch (OVS-DPDK) within the Red Hat OpenStack Platform (RHOSP) environment. The overcloud usually consists of nodes in predefined roles such as Controller nodes, Compute nodes, and different storage node types. Each of these default roles contains a set of services defined in the core heat templates on the director node.
You must install and configure the undercloud before you can deploy the overcloud. For more information, see: Director Installation and Usage Guide.
You must determine the best values for the OVS-DPDK parameters that you set in the network-environment.yaml
file to optimize your RHOSP network for OVS-DPDK.
Do not edit or change isolated_cores
or other values in etc/tuned/cpu-partitioning-variables.conf
that are modified by these director heat templates.
8.1. Deriving DPDK parameters with workflows Copy linkLink copied to clipboard!
This feature is available in this release as a Technology Preview, and therefore is not fully supported by Red Hat. It should only be used for testing, and should not be deployed in a production environment. For more information about Technology Preview features, see Scope of Coverage Details.
For an overview of the Mistral workflow for DPDK, see Section 7.2, “Overview of workflows and derived parameters”.
Prerequisites
You must have Bare Metal introspection, including hardware inspection_extras
, enabled to generate the data retrieved by this workflow. Hardware inspection extras are enabled by default. See Inspecting the Hardware of Nodes.
Define the Workflows and Input Parameters for DPDK
The following lists the input parameters you can provide to the OVS-DPDK workflows:
- num_phy_cores_per_numa_node_for_pmd
- This input parameter specifies the required minimum number of cores for the NUMA node associated with the DPDK NIC. One physical core is assigned for the other NUMA nodes not associated with DPDK NIC. Ensure that this parameter is set to 1.
- huge_page_allocation_percentage
-
This input parameter specifies the required percentage of total memory (excluding
NovaReservedHostMemory
) that can be configured as huge pages. TheKernelArgs
parameter is derived using the calculated huge pages based on thehuge_page_allocation_percentage
specified. Ensure that this parameter is set to 50.
The workflows use these input parameters and the bare-metal introspection details to calculate appropriate DPDK parameter values.
Perform the following steps to define the workflows and input parameters for DPDK:
Copy the
usr/share/openstack-tripleo-heat-templates/plan-samples/plan-environment-derived-params.yaml
file to a local directory and set the input parameters to suit your environment.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
openstack overcloud deploy
command with the following options:-
The
update-plan-only
option - The role file and all environment files specific to your environment
The
plan-environment-derived-parms.yaml
file with the--plan-environment-file
optional argumentopenstack overcloud deploy --templates --update-plan-only \ -r /home/stack/roles_data.yaml \ -e /home/stack/<environment-file> \ ... #repeat as necessary ...
$ openstack overcloud deploy --templates --update-plan-only \ -r /home/stack/roles_data.yaml \ -e /home/stack/<environment-file> \ ... #repeat as necessary ... -p /home/stack/plan-environment-derived-params.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
The
The output of this command shows the derived results, which are also merged into the plan-environment.yaml
file.
You cannot derive the OvsDpdkMemoryChannels
parameter from introspection details. In most cases, this value should be 4.
Deploy the overcloud with the derived parameters
Perform the following steps to deploy the overcloud with these derived parameters:
Copy the derived parameters from the deploy command output to the
network-environment.yaml
file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThese parameters apply to the specific role, ComputeOvsDpdk. You can apply these parameters globally, but role-specific parameters overwrite global parameters.
- Deploy the overcloud using the role file and all environment files specific to your environment. For more information, see Deploying the Overcloud.
In a cluster with Compute, ComputeOvsDpdk and ComputeSriov, the existing workflow to derive parameters applies the formula to the ComputeOvsDpdk role only.
8.2. OVS-DPDK topology Copy linkLink copied to clipboard!
With Red Hat OpenStack Platform, you can create custom deployment roles, using the composable roles feature, adding or removing services from each role. For more information on Composable Roles, see Composable Roles and Services.
This image shows an example Open vSwitch with Data Plane Development Kit (OVS-DPDK) topology with two bonded ports for the control plane and data plane:
To configure OVS-DPDK, complete the following tasks:
-
If you use composable roles, copy and modify the
roles_data.yaml
file to add the custom role for OVS-DPDK. -
Update the appropriate
network-environment.yaml
file to include parameters for kernel arguments and DPDK arguments. -
Update the
compute.yaml
file to include the bridge for DPDK interface parameters. -
Update the
controller.yaml
file to include the same bridge details for DPDK interface parameters. -
Run the
overcloud_deploy.sh
script to deploy the overcloud with the DPDK parameters.
This guide provides examples for CPU assignments, memory allocation, and NIC configurations that can vary from your topology and use case. For more information about hardware and configuration options, see: Network Functions Virtualization Product Guide and Chapter 2, Hardware requirements.
Prerequisites
- OVS 2.10
- DPDK 17
- Tested NIC. For a list of tested NICs for NFV, see Section 2.1, “Tested NICs”.
Red Hat OpenStack Platform operates in OVS client mode for OVS-DPDK deployments.
8.3. Setting the MTU value for OVS-DPDK interfaces Copy linkLink copied to clipboard!
Red Hat OpenStack Platform supports jumbo frames for Open vSwitch with Data Plane Development Kit (OVS-DPDK). To set the maximum transmission unit (MTU) value for jumbo frames you must:
-
Set the global MTU value for networking in the
network-environment.yaml
file. -
Set the physical DPDK port MTU value in the
compute.yaml
file. This value is also used by the vhost user interface. - Set the MTU value within any guest instances on the Compute node to ensure that you have a comparable MTU value from end to end in your configuration.
VXLAN packets include an extra 50 bytes in the header. Calculate your MTU requirements based on these additional header bytes. For example, an MTU value of 9000 means the VXLAN tunnel MTU value is 8950 to account for these extra bytes.
You do not need any special configuration for the physical NIC because the NIC is controlled by the DPDK PMD and has the same MTU value set by the compute.yaml
file. You cannot set an MTU value larger than the maximum value supported by the physical NIC.
To set the MTU value for OVS-DPDK interfaces:
Set the
NeutronGlobalPhysnetMtu
parameter in thenetwork-environment.yaml
file.parameter_defaults: # MTU global configuration NeutronGlobalPhysnetMtu: 9000
parameter_defaults: # MTU global configuration NeutronGlobalPhysnetMtu: 9000
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteEnsure that the NeutronDpdkSocketMemory value in the
network-environment.yaml
file is large enough to support jumbo frames. See Section 7.4.2, “Memory parameters” for details.Set the MTU value on the bridge to the Compute node in the
controller.yaml
file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the MTU values for an OVS-DPDK bond in the
compute.yaml
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.4. Configuring a firewall for security groups Copy linkLink copied to clipboard!
Data plane interfaces require a high degree of performance in a stateful firewall. To protect these interfaces, consider deploying a telco grade firewall as a virtual network function (VNF).
To configure the control plane interfaces, set the NeutronOVSFirewallDriver
parameter to openvswitch
. This configures Red Hat OpenStack Platform Networking to use the flow-based OVS firewall driver. This is set in the network-environment.yaml
file under parameter_defaults
.
Example:
parameter_defaults: NeutronOVSFirewallDriver: openvswitch
parameter_defaults:
NeutronOVSFirewallDriver: openvswitch
It is important to disable OVS firewall driver for data plane interfaces, where applicable. This can be done with the openstack port set
command.
Example:
openstack port set --no-security-group --disable-port-security ${PORT}
openstack port set --no-security-group --disable-port-security ${PORT}
8.5. Setting multiqueue for OVS-DPDK interfaces Copy linkLink copied to clipboard!
To set set same number of queues for interfaces in Open vSwitch with Data Plane Development Kit (OVS-DPDK) on the Compute node, modify the compute.yaml
file:
8.6. Deploying the overcloud Copy linkLink copied to clipboard!
Ensure parameters for your DPDK compute role populate in
network-environment.yaml
. If necessary, copy these parameters from: derived OVS-DPDK.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the overcloud using the
openstack overcloud deploy
command.- Include the role file and all environment files specific to your environment.
Apply the
KernelArgs
andTunedProfile
parameters by including thehost-config-and-reboot.yaml
file from/usr/share/openstack-tripleo-heat-templates/environments
to your deployment script:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.7. Known limitations Copy linkLink copied to clipboard!
There are limitations when configuring OVS-DPDK with Red Hat OpenStack Platform for the NFV use case:
- Use Linux bonds for control plane networks. Ensure that the PCI devices in the Linux bond are on the same NUMA node for optimum performance. Red Hat does not support Neutron Linux bridge configuration.
- Every instance running on the hosts with OVS-DPDK requires huge pages. If huge pages are not present in the guest, the interface appears but does not function.
- With OVS-DPDK, there is a performance degradation of services that use tap devices, such as Distributed Virtual Routing (DVR). The resulting performance is not suitable for a production environment.
-
When using OVS-DPDK, all bridges on the same Compute node must be of type
ovs_user_bridge
. The director might accept the configuration, but Red Hat does not support mixingovs_bridge
andovs_user_bridge
on the same node.
8.8. Creating a flavor and deploying an instance for OVS-DPDK Copy linkLink copied to clipboard!
After you configure Open vSwitch with Data Plane Development Kit (OVS-DPDK) for your Red Hat OpenStack Platform deployment with NFV, you can create a flavor and deploy an instance with the following steps:
Create an aggregate group and add relevant hosts for OVS-DPDK. Define metadata, for example
dpdk=true
, that matches defined flavor metadata.openstack aggregate create dpdk_group
# openstack aggregate create dpdk_group # openstack aggregate add host dpdk_group [compute-host] # openstack aggregate set --property dpdk=true dpdk_group
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUse host aggregates to separate CPU-pinned instances from unpinned instances. Instances without CPU pinning have different resourcing requirements of instances with CPU pinning.
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,
dpdk=true
, matches the defined metadata in the DPDK aggregate.openstack flavor set <flavor> --property dpdk=true --property hw:cpu_policy=dedicated --property hw:mem_page_size=1GB --property hw:emulator_threads_policy=isolate
# openstack flavor set <flavor> --property dpdk=true --property hw:cpu_policy=dedicated --property hw:mem_page_size=1GB --property hw:emulator_threads_policy=isolate
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example,
m1.medium_huge_4cpu
is the flavor name and the remaining parameters set the other properties for the flavor.For details on the emulator threads policy for performance improvements, see: Configure Emulator Threads to run on a Dedicated Physical CPU.
Create the network.
openstack network create net1 --provider-physical-network tenant --provider-network-type vlan --provider-segment <VLAN-ID> openstack subnet create subnet1 --network net1 --subnet-range 192.0.2.0/24 --dhcp
# openstack network create net1 --provider-physical-network tenant --provider-network-type vlan --provider-segment <VLAN-ID> # openstack subnet create subnet1 --network net1 --subnet-range 192.0.2.0/24 --dhcp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy an instance.
openstack server create --flavor <flavor> --image <glance image> --nic net-id=<network ID>
# openstack server create --flavor <flavor> --image <glance image> --nic net-id=<network ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
To use multi-queue with OVS-DPDK, set the hw_vif_multiqueue_enabled
property on an image, before you set the hw.vif_multiqueue_enabled
property on a flavor:
Set the image properties.
openstack image set --property hw_vif_multiqueue_enabled=true <image>
# openstack image set --property hw_vif_multiqueue_enabled=true <image>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set additional flavor properties.
openstack flavor set --property hw:vif_multiqueue_enabled=true <flavor>
# openstack flavor set --property hw:vif_multiqueue_enabled=true <flavor>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.9. Troubleshooting the configuration Copy linkLink copied to clipboard!
This section describes the steps to troubleshoot the Open vSwitch with Data Plane Development Kit (DPDK-OVS) configuration.
Review the bridge configuration and confirm that the bridge was created with the
datapath_type=netdev
.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the docker container
neutron_ovs_agent
is configured to start automatically.docker inspect neutron_ovs_agent | grep -A1 RestartPolicy
# docker inspect neutron_ovs_agent | grep -A1 RestartPolicy "RestartPolicy": { "Name": "always",
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the container has issues with starting, you can view any related messages.
less /var/log/containers/neutron/openvswitch-agent.log
# less /var/log/containers/neutron/openvswitch-agent.log
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the PMD CPU mask of the
ovs-dpdk
are pinned to the CPUs. In case of HT, use sibling CPUs.For example, observe CPU 4:
cat /sys/devices/system/cpu/cpu4/topology/thread_siblings_list 4,20
# cat /sys/devices/system/cpu/cpu4/topology/thread_siblings_list 4,20
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use CPU 4 and 20:
ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x100010
# ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x100010
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Display their status:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow