9.3. 在 OVS-DPDK 部署中保存电源


在 Red Hat Enterprise Linux 9 (RHEL 9)中引入了节能配置集 cpu-partitioning-powersave,现在在 Red Hat OpenStack Platform (RHOSP) 17.1.3 中提供。此 TuneD 配置集是在 RHOSP 17.1 NFV 环境中节省电源的基本构建块。

先决条件

  • 访问 stack 用户的 undercloud 主机和凭据。
  • 启用要实现节能的 CPU,以允许更高的 C-states。

    如需更多信息,请参阅 tuned-profiles-cpu-partitioning (7) 的 man page 中的 max_power_state 选项。

流程

  1. stack 用户的身份登录 undercloud。
  2. Source stackrc 文件:

    $ source ~/stackrc
    Copy to Clipboard Toggle word wrap
  3. 创建一个 Ansible playbook YAML 文件,如 /home/stack/cli-overcloud-tuned-maxpower-conf.yaml
  4. cli-overcloud-tuned-maxpower-conf.yaml 文件中添加以下配置:

    cat <<EOF > /home/stack/cli-overcloud-tuned-maxpower-conf.yaml
    {% raw %}
    ---
    #/home/stack/cli-overcloud-tuned-maxpower-conf.yaml
    - name: Overcloud Node set tuned power state
      hosts: compute-0 compute-1
      any_errors_fatal: true
      gather_facts: false
      pre_tasks:
        - name: Wait for provisioned nodes to boot
          wait_for_connection:
            timeout: 600
            delay: 10
          connection: local
      tasks:
        - name: Check the max power state for this system
          become: true
          block:
            - name: Get power states
              shell: "for s in /sys/devices/system/cpu/cpu2/cpuidle/*; do grep . $s/{name,latency}; done"
              register: _list_of_power_states
            - name: Print available power states
              debug:
                msg: "{{ _list_of_power_states.stdout.split('\n') }}"
            - name: Check for active tuned power-save profile
              stat:
                path: "/etc/tuned/active_profile"
              register: _active_profile
            - name: Check the profile
              slurp:
                path: "/etc/tuned/active_profile"
              when: _active_profile.stat.exists
              register: _active_profile_name
            - name: Print states
              debug:
                var: (_active_profile_name.content|b64decode|string)
            - name: Check the max power state for this system
              block:
                - name: Check if the cstate config is present in the conf file
                  lineinfile:
                    dest: /etc/tuned/cpu-partitioning-powersave-variables.conf
                    regexp: '^max_power_state'
                    line: 'max_power_state=cstate.name:C6'
                  register: _cstate_entry_check
    {% endraw %}
    EOF
    Copy to Clipboard Toggle word wrap
  5. 在角色数据文件中添加节能配置集。

    如需更多信息,请参阅 10.2。生成角色和镜像文件

  6. cli-overcloud-tuned-maxpower-conf.yaml playbook 添加到裸机节点定义文件。

    如需更多信息,请参阅 10.5。创建裸机节点定义文件

  7. 确保在 NIC 配置模板中设置了队列大小。

    如需更多信息,请参阅 10.6。创建 NIC 配置模板

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部