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选项。
流程
-
以
stack用户的身份登录 undercloud。 Source
stackrc文件:$ source ~/stackrc-
创建一个 Ansible playbook YAML 文件,如
/home/stack/cli-overcloud-tuned-maxpower-conf.yaml。 在
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在角色数据文件中添加节能配置集。
如需更多信息,请参阅 10.2。生成角色和镜像文件。
将
cli-overcloud-tuned-maxpower-conf.yamlplaybook 添加到裸机节点定义文件。如需更多信息,请参阅 10.5。创建裸机节点定义文件。
确保在 NIC 配置模板中设置了队列大小。
如需更多信息,请参阅 10.6。创建 NIC 配置模板。