第 8 章 配置 OVS-DPDK 部署


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

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

重要

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

注意

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

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:
          # DPDK Parameters #
          # Specifies 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
  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**

此命令的输出显示派生结果,结果也合并到 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,2,3,4,5,6,7,9,10,17,18,19,20,21,22,23,11,12,13,14,15,25,26,27,28,29,30,31
 KernelArgs: default_hugepagesz=1GB hugepagesz=1G hugepages=32 iommu=pt intel_iommu=on
   isolcpus=1,2,3,4,5,6,7,9,10,17,18,19,20,21,22,23,11,12,13,14,15,25,26,27,28,29,30,31
 NovaReservedHostMemory: 4096
 NovaComputeCpuDedicatedSet: 2,3,4,5,6,7,18,19,20,21,22,23,10,11,12,13,14,15,26,27,28,29,30,31
 OvsDpdkMemoryChannels: 4
 OvsDpdkSocketMemory: 1024,1024
 OvsPmdCoreList: 1,17,9,25
注意

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

使用派生参数部署 overcloud

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

  1. 将派生的参数从 deploy 命令输出中复制到 network-environment.yaml 文件。

      # DPDK compute node.
      ComputeOvsDpdkParameters:
        KernelArgs: default_hugepagesz=1GB hugepagesz=1G hugepages=32 iommu=pt intel_iommu=on
        TunedProfileName: "cpu-partitioning"
        IsolCpusList: "1,2,3,4,5,6,7,9,10,17,18,19,20,21,22,23,11,12,13,14,15,25,26,27,28,29,30,31"
        NovaComputeCpuDedicatedSet: ['2,3,4,5,6,7,18,19,20,21,22,23,10,11,12,13,14,15,26,27,28,29,30,31']
        NovaReservedHostMemory: 4096
        OvsDpdkSocketMemory: "1024,1024"
        OvsDpdkMemoryChannels: "4"
        OvsPmdCoreList: "1,17,9,25"
    注意

    这些参数应用到特定的角色 ComputeOvsDpdk。您可以在全局范围内应用这些参数,但特定于角色的参数覆盖任何全局参数。

  2. 使用角色文件以及特定于您的环境的所有环境文件,部署 overcloud。
 openstack overcloud deploy --templates \
 -r /home/stack/roles_data.yaml \
 -e /home/stack/<environment-file> \
... #repeat as necessary ...
注意

在使用 Compute、ComputeOvsDpdk 和 ComputeSriov 的集群中,工作流只为 ComputeOvsDpdk 角色应用公式,而不是 Compute 或 ComputeSriovs。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat, Inc.