第10章 例: ODL および VXLAN トンネリングを使用する OVS-DPDK の設定
本項では、OVS-DPDK with ODL および VXLAN トンネリングを使用した OVS-DPDK 設定の例について説明します。
OVS-DPDK 向けの OpenStack ネットワークを最適化するには、network-environment.yaml ファイルで設定する OVS-DPDK パラメーターの最も適切な値を決定する必要があります。詳しくは、「ワークフローを使用した DPDK パラメーターの算出」を参照してください。
10.1. ComputeOvsDpdk コンポーザブルロールの生成
ComputeOvsDpdk ロール用の roles_data.yaml を生成します。
# openstack overcloud roles generate --roles-path templates/openstack-tripleo-heat-templates/roles -o roles_data.yaml Controller ComputeOvsDpdk
10.2. CPU アフィニティー向けの tuned の設定
tunedの設定で CPU アフィニティーを有効にするように設定します。heat_template_version: 2014-10-16 description: > Example extra config for post-deployment parameters: servers: type: json DeployIdentifier: type: string default: '' resources: ExtraDeployments: type: OS::Heat::StructuredDeployments properties: servers: {get_param: servers} config: {get_resource: ExtraConfig} actions: ['CREATE','UPDATE'] input_values: deploy_identifier: {get_param: DeployIdentifier} ExtraConfig: type: OS::Heat::SoftwareConfig properties: group: script config: | #!/bin/bash set -x function tuned_service_dependency() { tuned_service=/usr/lib/systemd/system/tuned.service grep -q "network.target" $tuned_service if [ "$?" -eq 0 ]; then sed -i '/After=.*/s/network.target//g' $tuned_service fi grep -q "Before=.*network.target" $tuned_service if [ ! "$?" -eq 0 ]; then grep -q "Before=.*" $tuned_service if [ "$?" -eq 0 ]; then sed -i 's/^\(Before=.*\)/\1 network.target openvswitch.service/g' $tuned_service else sed -i '/After/i Before=network.target openvswitch.service' $tuned_service fi fi } if hiera -c /etc/puppet/hiera.yaml service_names | grep -q neutron_ovs_dpdk_agent; then tuned_service_dependency fi
10.3. OVS-DPDK パラメーターの設定
OVS-DPDK 向けの OpenStack ネットワークを最適化するには、network-environment.yaml ファイルで設定する OVS-DPDK パラメーターの最も適切な値を決定する必要があります。詳しくは、「ワークフローを使用した DPDK パラメーターの算出」を参照してください。を参照してください。
resource_registry下には、OVS-DPDK 用のカスタムリソースを追加します。resource_registry: # Specify the relative/absolute path to the config files you want to use for override the default. OS::TripleO::ComputeOvsDpdk::Net::SoftwareConfig: nic-configs/computeovsdpdk.yaml OS::TripleO::Controller::Net::SoftwareConfig: nic-configs/controller.yaml OS::TripleO::NodeExtraConfigPost: post-install.yamlparameter_defaults下には、トンネルの種別とテナントの種別をvxlanに設定します。NeutronTunnelTypes: 'vxlan' NeutronNetworkType: 'vxlan'
parameters_defaults下には、ブリッジマッピングを設定します。# The OVS logical->physical bridge mappings to use. NeutronBridgeMappings: 'tenant:br-link0' OpenDaylightProviderMappings: 'tenant:br-link0'
parameter_defaults下には、ComputeOvsDpdkロール向けにロール固有のパラメーターを設定します。########################## # OVS DPDK configuration # ########################## ComputeOvsDpdkParameters: KernelArgs: "default_hugepagesz=1GB hugepagesz=1G hugepages=32 iommu=pt intel_iommu=on isolcpus=2-19,22-39" TunedProfileName: "cpu-partitioning" IsolCpusList: "2-19,22-39" NovaVcpuPinSet: ['4-19,24-39'] NovaReservedHostMemory: 4096 OvsDpdkSocketMemory: "4096,4096" OvsDpdkMemoryChannels: "4" OvsDpdkCoreList: "0,20,1,21" OvsPmdCoreList: "2,22,3,23" OvsEnableDpdk: true注記DPDK PMD 向けに DPDK NIC のある場合またはない場合も、各 NUMA ノードで少なくとも 1 CPU を (シブリングスレッドとともに) 割り当てて、ゲストインスタンスの作成でエラーが発生するのを回避する必要があります。
注記これらのヒュージページは、仮想マシンにより消費されます。また、本手順に示したように
OvsDpdkSocketMemoryパラメーターを使用すると OVS-DPDK により消費されます。仮想マシンが利用可能なヒュージページ数は、bootパラメーターからOvsDpdkSocketMemoryを減算した値です。DPDK インスタンスに関連付けたフレーバーにも
hw:mem_page_size=1GBを追加する必要があります。注記OvsDPDKCoreListとOvsDpdkMemoryChannelsは、この手順の 必須 の設定です。適切な値なしに DPDK をデプロイしようとすると、デプロイが失敗するか、デプロイが不安定になる可能性があります。
10.4. コントローラーノードの設定
分離ネットワーク用にコントロールプレーンの Linux ボンディングを作成します。
- type: linux_bond name: bond_api bonding_options: "mode=active-backup" use_dhcp: false dns_servers: get_param: DnsServers addresses: - ip_netmask: list_join: - / - - get_param: ControlPlaneIp - get_param: ControlPlaneSubnetCidr routes: - ip_netmask: 169.254.169.254/32 next_hop: get_param: EC2MetadataIp members: - type: interface name: eth1 primary: trueこの Linux ボンディングに VLAN を割り当てます。
- 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 - type: vlan vlan_id: get_param: StorageMgmtNetworkVlanID device: bond_api addresses: - ip_netmask: get_param: StorageMgmtIpSubnet - type: vlan vlan_id: get_param: ExternalNetworkVlanID device: bond_api addresses: - ip_netmask: get_param: ExternalIpSubnet routes: - default: true next_hop: get_param: ExternalInterfaceDefaultRouteクラウドネットワークへの接続を可能にする Floating IP にアクセスするための OVS ブリッジを作成します。
- type: ovs_bridge name: br-link0 use_dhcp: false mtu: 9000 members: - type: interface name: eth2 mtu: 9000 - type: vlan vlan_id: get_param: TenantNetworkVlanID mtu: 9000 addresses: - ip_netmask: get_param: TenantIpSubnet
10.5. DPDK インターフェース用のコンピュートノードの設定
デフォルトの compute.yaml ファイルから compute-ovs-dpdk.yaml を作成し、以下のように変更します。
分離ネットワーク用にコントロールプレーンの Linux ボンディングを作成します。
- type: linux_bond name: bond_api bonding_options: "mode=active-backup" use_dhcp: false dns_servers: get_param: DnsServers members: - type: interface name: nic7 primary: true - type: interface name: nic8この Linux ボンディングに VLAN を割り当てます。
- 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: nic3 - type: ovs_dpdk_port name: dpdk1 members: - type: interface name: nic4注記複数の DPDK デバイスが含まれるようにするには、追加する各 DPDK デバイスごとに
typeコードセクションを繰り返してください。注記OVS-DPDK を使用する場合には、同じコンピュートノード上の すべて のブリッジが
ovs_user_bridgeの種別である必要があります。director は設定を受け入れることができますが、Red Hat OpenStack Platform は同じノード上でovs_bridgeとovs_user_bridgeが混在する構成はサポートしていません。
10.6. オーバークラウドのデプロイ
overcloud_deploy.sh スクリプトを実行してオーバークラウドをデプロイします。
#!/bin/bash openstack overcloud deploy \ --templates \ -r /home/stack/ospd-13-vxlan-dpdk-odl-ctlplane-dataplane-bonding-hybrid/roles_data.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/host-config-and-reboot.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/services-docker/neutron-opendaylight.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/services-docker/neutron-opendaylight-dpdk.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/ovs-dpdk-permissions.yaml \ -e /home/stack/ospd-13-vxlan-dpdk-odl-ctlplane-dataplane-bonding-hybrid/docker-images.yaml \ -e /home/stack/ospd-13-vxlan-dpdk-odl-ctlplane-dataplane-bonding-hybrid/network-environment.yaml

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.