此内容没有您所选择的语言版本。
Chapter 3. Configure SR-IOV Support for Virtual Networking
This chapter covers the configuration of Single Root Input/Output Virtualization (SR-IOV) within the Red Hat OpenStack Platform 10 environment using the director.
This guide provides examples for CPU assignments, memory allocation, and NIC configurations that may vary from your topology and use case. See the Network Functions Virtualization Product Guide and the Network Functions Virtualization Planning Guide to understand the hardware and configuration options.
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.
In the following procedure, you need to update the network-environment.yaml file to include parameters for kernel arguments, SR-IOV driver, PCI passthrough and so on. You must also update the compute.yaml file to include the SR-IOV interface parameters, and run the overcloud_deploy.sh script to deploy the overcloud with the SR-IOV parameters.
3.1. Configure Two-port SR-IOV with VLAN Tunnelling 复制链接链接已复制到粘贴板!
This section describes the YAML files you need to modify to configure SR-IOV with two ports that use VLAN tunnelling for your OpenStack environment.
3.1.1. Modify first-boot.yaml 复制链接链接已复制到粘贴板!
If you have included the following lines in the first-boot.yaml file in a previous deployment, remove these lines for Red Hat OpenStack Platform 10 with Open vSwitch 2.9.
Set the
tunedconfiguration to enable CPU affinity.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the Kernel arguments:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.2. Modify network-environment.yaml 复制链接链接已复制到粘贴板!
Add
first-boot.yamlunderresource_registryto set the CPU tuning.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, disable the tunnel type (set the value to""), and set network type tovlan.NeutronTunnelTypes: '' NeutronNetworkType: 'vlan'
NeutronTunnelTypes: '' NeutronNetworkType: 'vlan'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, map the Open vSwitch physical network to the bridge.NeutronBridgeMappings: 'tenant:br-link0'
NeutronBridgeMappings: 'tenant:br-link0'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, set the OpenStack Networking ML2 and Open vSwitch VLAN mapping range.NeutronNetworkVLANRanges: 'tenant:22:22,tenant:25:25'
NeutronNetworkVLANRanges: 'tenant:22:22,tenant:25:25'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, set the SR-IOV configuration parameters.Enable the SR-IOV mechanism driver (
sriovnicswitch).NeutronMechanismDrivers: "openvswitch,sriovnicswitch"
NeutronMechanismDrivers: "openvswitch,sriovnicswitch"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the Compute
pci_passthrough_whitelistparameter, and setdevnamefor the SR-IOV interface. The whitelist sets the PCI devices available to instances.NovaPCIPassthrough: - devname: "p7p1" physical_network: "tenant" - devname: "p7p2" physical_network: "tenant"NovaPCIPassthrough: - devname: "p7p1" physical_network: "tenant" - devname: "p7p2" physical_network: "tenant"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the physical network and SR-IOV interface in the format -
PHYSICAL_NETWORK:PHYSICAL DEVICE.All physical networks listed in the
network_vlan_rangeson the server should have mappings to the appropriate interfaces on each agent.NeutronPhysicalDevMappings: "tenant:p7p1,tenant:p7p2"
NeutronPhysicalDevMappings: "tenant:p7p1,tenant:p7p2"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Provide the number of Virtual Functions (VFs) to be reserved for each SR-IOV interface.
Red Hat OpenStack Platform supports the number of VFs supported by the NIC vendor. See Deployment Limits for Red Hat OpenStack Platform for other related details. This example reserves 5 VFs for each of the SR-IOV interfaces:
NeutronSriovNumVFs: "p7p1:5,p7p2:5"
NeutronSriovNumVFs: "p7p1:5,p7p2:5"Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteChanging the
NeutronSriovNumVFsparameter 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.
Under
parameter_defaults, reserve the RAM for the host processes.NovaReservedHostMemory: 4096
NovaReservedHostMemory: 4096Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, set a comma-separated list or range of physical CPU cores to reserve for virtual machine processes.NovaVcpuPinSet: "1-19,21-39"
NovaVcpuPinSet: "1-19,21-39"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, list the the applicable filters.Nova scheduler applies these filters in the order they are listed. List the most restrictive filters first to make the filtering process for the nodes more efficient.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Under
parameter_defaults, define theComputeKernelArgsparameters to be included in the defaultgrubfile at first boot.ComputeKernelArgs: "default_hugepagesz=1GB hugepagesz=1G hugepages=12 intel_iommu=on iommu=pt"
ComputeKernelArgs: "default_hugepagesz=1GB hugepagesz=1G hugepages=12 intel_iommu=on iommu=pt"Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou need to add
hw:mem_page_size=1GBto the flavor you associate with the DPDK instance. If you do not do this, the instance does not get a DHCP allocation.Under
parameter_defaults, set a list or range of physical CPU cores to be tuned.The given argument is appended to the tuned
cpu-partitioningprofile.HostIsolatedCoreList: "1-19,21-39"
HostIsolatedCoreList: "1-19,21-39"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.3. Modify controller.yaml 复制链接链接已复制到粘贴板!
Create the Linux bond for an isolated network.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Assign VLANs to this Linux bond.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the OVS bridge for access to neutron-dhcp-agent and neutron-metadata-agent services.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.4. Modify compute.yaml 复制链接链接已复制到粘贴板!
Create the Linux bond for an isolated network.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Assign VLANs to this Linux bond.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the two SR-IOV interfaces by adding the following to the
compute.yamlfile.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.5. Run the overcloud_deploy.sh Script 复制链接链接已复制到粘贴板!
The following example defines the openstack overcloud deploy command for the VLAN environment.
-
/usr/share/openstack-tripleo-heat-templates/environments/neutron-sriov.yamlis the location of the defaultneutron-sriov.yamlfile, which enables the SR-IOV parameters in the Compute node. -
/home/stack/<relative-directory>/network-environment.yamlis the path for thenetwork-environment.yamlfile. The defaultneutron-sriov.yamlvalues can be overridden innetwork-environment.yamlfile.
3.2. Create a Flavor and Deploy an Instance for SR-IOV 复制链接链接已复制到粘贴板!
After you have completed configuring SR-IOV for your Red Hat OpenStack Platform deployment with NFV, you need to create a flavor and deploy an instance by performing the following steps.
Create an aggregate group and add a host to it for SR-IOV. Define metadata, for example,
"aggregate_instance_extra_specs:sriov"="true", that matches flavor metadata.openstack aggregate create sriov_group
# openstack aggregate create sriov_group # openstack aggregate set --property \ "aggregate_instance_extra_specs:sriov"="true" sriov_group # openstack aggregate add host sriov compute-sriov-0.localdomainCopy 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,
"aggregate_instance_extra_specs:sriov"="true", matches the defined metadata on the SR-IOV aggregate.openstack flavor set --property "aggregate_instance_extra_specs:sriov"="true" \ --property hw:cpu_policy=dedicated \ --property hw:mem_page_size=large <flavor>
# openstack flavor set --property "aggregate_instance_extra_specs:sriov"="true" \ --property hw:cpu_policy=dedicated \ --property hw:mem_page_size=large <flavor>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 subnet.
openstack subnet create subnet1 --network net1 --subnet-range 192.0.2.0/24 --dhcp
# openstack subnet create subnet1 --network net1 --subnet-range 192.0.2.0/24 --dhcpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the port.
Use
vnic-typedirect to create an SR-IOV VF port.openstack port create --network net1 --vnic-type direct sriov_port
# openstack port create --network net1 --vnic-type direct sriov_portCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use
vnic-typedirect-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_portCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Deploy an instance.
openstack server create --flavor <flavor> --image <glance_image> --nic port-id=sriov_port <name>
# openstack server create --flavor <flavor> --image <glance_image> --nic port-id=sriov_port <name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You have now deployed an instance for the SR-IOV with NFV use case.