Modify Host Personality for attribute max_cpu_mhz_configured

Max_cpu_mhz_personality is the attribute of the host which
can be configured in host where turbo freq is enabled.In case
of host whose role is both controller and worker, the personality
for the attribute was not taken care to include such scenario.

Made the changes in the sysinv conductor to update the host
personalities based on the function that node operates, which
handles the scenario when the host acts as both controller and
worker node.

TEST PLAN:
PASS: Build and deploy ISO on Simplex
PASS: Check whether the max cpu freq set on a simplex
      Below are the commands:
      system host-show <host_id> | grep is_max_cpu_configurable
      system service-parameter-list --name cpu_max_freq_min_percentage
      system service-parameter-modify platform config cpu_max_freq_min_percentage=<>
      system host-update <host_id> max_cpu_mhz_configured=<value in mhz>

      After above commands check whether cpu is set using below command:
      sudo turbostat

Closes-Bug: 2058476

Change-Id: I08a5d1400834afca6a0eeaaa8813ac8d71a9db15
Signed-off-by: Poornima Y N <Poornima.Y.N@windriver.com>
This commit is contained in:
Poornima Y N 2024-03-20 07:15:52 -04:00
parent 15aefdc468
commit 7fc11de9ee
1 changed files with 5 additions and 1 deletions

View File

@ -15789,7 +15789,11 @@ class ConductorManager(service.PeriodicService):
labels = self.dbapi.label_get_by_host(host['uuid'])
if not cutils.has_power_management_enabled(labels):
personalities = [constants.WORKER]
if cutils.is_aio_system(self.dbapi):
personalities = [constants.WORKER,
constants.CONTROLLER]
else:
personalities = [constants.WORKER]
config_uuid = self._config_update_hosts(context,
personalities,