第 8 章 配置 OVS-DPDK 部署


本节在 Red Hat OpenStack Platform 环境中使用 Open vSwitch (OVS-DPDK)部署 DPDK。overcloud 通常由预定义角色的节点组成,如 Controller 节点、计算节点和不同的存储节点类型。这些默认角色各自包含 director 节点上的核心 Heat 模板中定义的一组服务。

您必须先安装和配置 undercloud,然后才能部署 overcloud。详情请查看 Director 安装和使用指南

重要

您必须确定 network-environment.yaml 文件中设置的 OVS-DPDK 参数的最佳值,以优化 OVS-DPDK 的 OpenStack 网络。

注意

不要编辑或更改 etc/tuned/cpu-partitioning-variables.conf 中的 isolated_cores 或其他值,这些 director heat 模板修改。

8.1. 使用工作流推断 DPDK 参数

重要

该功能在此发行版本中作为技术预览提供,因此不享有红帽的全面支持。它只应用于测试,不应部署在生产环境中。有关技术预览功能的更多信息,请参阅覆盖范围详细信息

有关 DPDK 的 Mistral 工作流概述,请参阅 第 7.2 节 “工作流和派生参数概述”

前提条件

您必须启用裸机内省,包括启用硬件检查额外的(inspection_extras)来提供此工作流检索的数据。默认情况下启用硬件检查额外的功能。请参阅 检查节点的硬件

为 DPDK 定义工作流和输入参数

下表列出了您可以提供给 OVS-DPDK 工作流的输入参数:

num_phy_cores_per_numa_node_for_pmd
此输入参数指定与 DPDK NIC 关联的 NUMA 节点所需的最小内核数。为不与 DPDK NIC 关联的其他 NUMA 节点分配一个物理内核。这个参数应设置为 1。
huge_page_allocation_percentage
此输入参数指定配置为巨页所需的内存总量(不包括 NovaReservedHostMemory)。KernelArgs 参数使用基于指定的 huge_page_allocation_percentage 计算的巨页来派生。这个参数应设置为 50。

工作流使用这些输入参数以及裸机内省详情来计算适当的 DPDK 参数值。

为 DPDK 定义工作流和输入参数:

  1. /usr/share/openstack-tripleo-heat-templates/plan-samples/plan-environment-derived-params.yaml 文件复制到一个本地目录,并将输入参数设置为适合您的环境。

      workflow_parameters:
        tripleo.derive_params.v1.derive_parameters:
          EmptyEmpty# DPDK Parameters Empty#
          # Specifices the minimum number of CPU physical cores to be allocated for DPDK
          # PMD threads. The actual allocation will be based on network config, if
          # the a DPDK port is associated with a numa node, then this configuration
          # will be used, else 1.
          num_phy_cores_per_numa_node_for_pmd: 1
          # Amount of memory to be configured as huge pages in percentage. Ouf the
          # total available memory (excluding the NovaReservedHostMemory), the
          # specified percentage of the remaining is configured as huge pages.
          huge_page_allocation_percentage: 50
    Copy to Clipboard Toggle word wrap
  2. 运行 openstack overcloud deploy 命令并包含以下内容:

    • update-plan-only 选项
    • 特定于您的环境的角色文件和所有环境文件
    • plan-environment-derived-parms.yaml 文件,使用 --plan-environment-file 可选参数

      $ 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 Toggle word wrap

此命令的输出显示派生结果,结果也合并到 plan-environment.yaml 文件中。

Started Mistral Workflow tripleo.validations.v1.check_pre_deployment_validations. Execution ID: 55ba73f2-2ef4-4da1-94e9-eae2fdc35535
Waiting for messages on queue 472a4180-e91b-4f9e-bd4c-1fbdfbcf414f with no timeout.
Removing the current plan files
Uploading new plan files
Started Mistral Workflow tripleo.plan_management.v1.update_deployment_plan. Execution ID: 7fa995f3-7e0f-4c9e-9234-dd5292e8c722
Plan updated.
Processing templates in the directory /tmp/tripleoclient-SY6RcY/tripleo-heat-templates
Invoking workflow (tripleo.derive_params.v1.derive_parameters) specified in plan-environment file
Started Mistral Workflow tripleo.derive_params.v1.derive_parameters. Execution ID: 2d4572bf-4c5b-41f8-8981-c84a363dd95b
Workflow execution is completed. result:
ComputeOvsDpdkParameters:
 IsolCpusList: 1-7,17-23,9-15,25-31
 KernelArgs: default_hugepagesz=1GB hugepagesz=1G hugepages=32 iommu=pt intel_iommu=on isolcpus=1-7,17-23,9-15,25-31
 NovaReservedHostMemory: 4096
 NovaVcpuPinSet: 2-7,18-23,10-15,26-31
 OvsDpdkCoreList: 0,16,8,24
 OvsDpdkMemoryChannels: 4
 OvsDpdkSocketMemory: 1024,1024
 OvsPmdCoreList: 1,17,9,25
Copy to Clipboard Toggle word wrap
注意

OvsDpdkMemoryChannels 参数不能从内省详情衍生。在大多数情况下,这个值应该是 4。

使用 Derived 参数部署 Overcloud

使用这些派生参数部署 overcloud:

  1. 将派生的参数从 plan-environment.yaml 复制到 network-environment.yaml 文件。

      # DPDK compute node.
      ComputeOvsDpdkParameters:
        KernelArgs: default_hugepagesz=1GB hugepagesz=1G hugepages=32 iommu=pt intel_iommu=on isolcpus=1-7,17-23,9-15,25-31
        TunedProfileName: "cpu-partitioning"
        IsolCpusList: "1-7,17-23,9-15,25-31"
        NovaVcpuPinSet: ['2-7,18-23,10-15,26-31']
        NovaReservedHostMemory: 4096
        OvsDpdkSocketMemory: "1024,1024"
        OvsDpdkMemoryChannels: "4"
        OvsDpdkCoreList: "0,16,8,24"
        OvsPmdCoreList: "1,17,9,25"
    Copy to Clipboard Toggle word wrap
    注意

    这些参数专门用于角色 ComputeOvsDpdk,且不适用于其他角色,包括 同一集群中 可能存在的 Compute 或 ComputeSriov。您可以在全局范围内应用这些参数,但任何全局参数都会被特定于角色的参数覆盖。

  2. 使用角色文件以及特定于您的环境的所有环境文件,部署 overcloud。有关详细信息 ,请参阅部署 Overcloud
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat