12.4. 为 DPDK 和 SR-IOV 配置 Compute 节点
从默认 compute.yaml
文件创建 computeovsdpdksriov.yaml
文件,并进行以下更改:
为隔离的网络创建 control-plane Linux 绑定。
- type: linux_bond name: bond_api bonding_options: "mode=active-backup" use_dhcp: false dns_servers: get_param: DnsServers members: - type: interface name: nic3 primary: true - type: interface name: nic4
将 VLAN 分配给此 Linux 绑定。
- type: vlan vlan_id: get_param: InternalApiNetworkVlanID device: bond_api addresses: - ip_netmask: get_param: InternalApiIpSubnet - type: vlan vlan_id: get_param: StorageNetworkVlanID device: bond_api addresses: - ip_netmask: get_param: StorageIpSubnet
设置带有 DPDK 端口的网桥,以链接到控制器。
- type: ovs_user_bridge name: br-link0 use_dhcp: false ovs_extra: - str_replace: template: set port br-link0 tag=_VLAN_TAG_ params: _VLAN_TAG_: get_param: TenantNetworkVlanID addresses: - ip_netmask: get_param: TenantIpSubnet members: - type: ovs_dpdk_bond name: dpdkbond0 mtu: 9000 rx_queue: 2 members: - type: ovs_dpdk_port name: dpdk0 members: - type: interface name: nic7 - type: ovs_dpdk_port name: dpdk1 members: - type: interface name: nic8
注意要包含多个 DPDK 设备,请为您要添加的每个 DPDK 设备重复
类型
代码部分。注意使用 OVS-DPDK 时,同一 Compute 节点上的所有网桥都必须是
ovs_user_bridge
类型。Red Hat OpenStack Platform 不支持同一节点上的ovs_bridge
和ovs_user_bridge
。