전원 저장 프로필 cpu-partitioning-powersave 이 RHEL 9 (Red Hat Enterprise Linux 9)에 도입되었으며 RHOSP(Red Hat OpenStack Platform) 17.1.3에서 사용할 수 있습니다. 이 TuneD 프로필은 RHOSP 17.1 NFV 환경에서 전원을 절약하기 위한 기본 구성 요소입니다.
사전 요구 사항
언더클라우드 호스트 및 stack 사용자의 인증 정보에 액세스합니다.
더 높은 C-state를 허용하도록 전력 절감을 달성하려는 CPU가 활성화됩니다.
자세한 내용은 tuned-profiles-cpu-partitioning(7) 도움말 페이지의 max_power_state 옵션을 참조하십시오.
프로세스
stack 사용자로 언더클라우드에 로그인합니다.
stackrc 파일을 소싱합니다.
source ~/stackrc
$ source ~/stackrc
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Ansible 플레이북 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
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-1any_errors_fatal:truegather_facts:falsepre_tasks:-name: Wait for provisioned nodes to boot
wait_for_connection:timeout:600delay:10connection: local
tasks:-name: Check the max power state for this system
become:trueblock:-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 ClipboardCopied!Toggle word wrapToggle overflow