Select devices to disable APM

This commit is a part of the solution to mitigate a known issue that
the Advanced Power Management (APM) disk settings impacted read
performance. These settings are dynamically set based on the enabled
StarlingX tuned service profiles.

On some specific hardware configurations  (for example, PowerEdge XR11
with an integrated storage controller), degraded read performance was
observed where the Tuned Disk Monitor didn't detect high usage,
maintaining a limited and low APM level (default 20).
For write operations, a delay of about 60 seconds was noticed to
achive the highest disk performance.

Each unlocking will ensure the APM is disabled, but it can still be set
manually at runtime using: "sudo hdparm -B <apm_level> /dev/sda".

Ensuring it's disabled for all devices, we need to provide the names,
as Tuned retrieves all devices from /sys/block and attempts to apply
the apm_level setting for each one. After failing to apply it
three times (for example, with DRBD block devices), Tuned will disable
the set_apm command for the others.

For populate this parameter, it will needed to use the disks
persistent name (by-path value) from the inventory.

For example:
 devices_udev_regex=(ID_PATH=pci-...-ata-1.0)|(ID_PATH=pci-...-ata-2.0)

Test Plan:
  PASS: All packages built successfully
  PASS: Fresh Install SX/DX/STD in virtual environments
  PASS: After unlocking, verify that APM and Tuned Disk Monitor
        are disabled
  PASS: After unlocking, verify that /etc/tuned/starlingx/tuned.conf
        is populated with the selected devices
  PASS: All previous tests using XR11 lab
  PASS: After the initial unlock, the virtual host is locked,
        powered off, a disk is added, powered on, and after a new
        unlock, the new disk is added to devices_udev_regex.

Partial-bug: 2086509

Depends-on: https://review.opendev.org/c/starlingx/config/+/933893

Change-Id: Ifc81e6236f7d5a59d22c2c824ea0e30f137e9e79
Signed-off-by: Hediberto C Silva <hediberto.cavalcantedasilva@windriver.com>
This commit is contained in:
Hediberto C Silva 2024-11-04 17:00:30 -03:00
parent 58b05f7451
commit 920106ef17

View File

@ -252,6 +252,26 @@
line: "platform::config::hosts::host_records: {{ user_dns_host_records_lines }}"
when: user_dns_host_records
- name: Getting supported disk devices from udev
shell: |
import pyudev
from sysinv.common import constants as sysinv_constants
context = pyudev.Context()
output = ""
for device in context.list_devices(DEVTYPE='disk'):
if device.properties['MAJOR'] in sysinv_constants.VALID_MAJOR_LIST:
if 'ID_PATH' in device:
output += "(ID_PATH=%s)|" % device.properties['ID_PATH']
print(output[:-1])
args:
executable: /usr/bin/python
register: tuned_devices
- name: Write disk devices to StarlingX Tuned profile
lineinfile:
path: "{{ hieradata_workdir }}/runtime.yaml"
line: "platform::sysctl::params::tuned_devices: {{ tuned_devices.stdout }}"
when: mode == 'bootstrap'
- name: Add L4 service ports value to bootstrap runtime hieradata