From 705077ed56e778685fcada8598c3c5d4592a38a3 Mon Sep 17 00:00:00 2001 From: Iago Estrela Date: Thu, 14 Jul 2022 18:25:20 -0300 Subject: [PATCH] Nohz_full configuration hieradata needs to be updated The grub commandline parameters contains nohz_full grub which needs to be updated with something different than a cpu list for kernel isolation when the user decides to disable it by assigning the disable-nohz-full label. In this manner, the disabled string can be used to signal the kernel to restore this configuration to default. Closes-Bug: 1981762 Test plan: PASS: Disable nohz_full configuration in a standard worker by enabling disable-nohz-full label. PASS: Verify that /etc/default/grub doesn't contains nohz_full parameter. PASS: Verify that /sys/devices/system/cpu/nohz_full was restored to default. PASS: Enable nohz_full configuration in a standard worker by removing disable-nohz-full label. PASS: Verify that /sys/devices/system/cpu/nohz_full has the cpulist. PASS: Remove label and verify alarms and system overall health. PASS: Add label and verify alarms and system overall health. Signed-off-by: Iago Estrela Change-Id: I00b68faae2612088b8e2fe7aeb3900babe638ca0 --- .../sysinv/sysinv/sysinv/api/controllers/v1/label.py | 11 ++++++++++- sysinv/sysinv/sysinv/sysinv/puppet/platform.py | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/label.py b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/label.py index 2170d83d62..c204b5ffc9 100644 --- a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/label.py +++ b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/label.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2020 Wind River Systems, Inc. +# Copyright (c) 2018-2022 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -152,6 +152,11 @@ class LabelController(rest.RestController): sort_key=sort_key, sort_dir=sort_dir) + def _apply_manifest_after_label_operation(self, uuid, keys): + if common.LABEL_DISABLE_NOHZ_FULL in keys: + pecan.request.rpcapi.update_grub_config( + pecan.request.context, uuid) + @wsme_pecan.wsexpose(LabelCollection, types.uuid, types.uuid, int, wtypes.text, wtypes.text) def get_all(self, uuid=None, marker=None, limit=None, @@ -260,6 +265,8 @@ class LabelController(rest.RestController): uuid, host.hostname, constants.VIM_DEFAULT_TIMEOUT_IN_SECS) + self._apply_manifest_after_label_operation( + uuid, body.keys()) except Exception as e: LOG.warn(_("No response vim_api host:%s e=%s" % (host.hostname, e))) @@ -307,6 +314,8 @@ class LabelController(rest.RestController): host.uuid, host.hostname, constants.VIM_DEFAULT_TIMEOUT_IN_SECS) + self._apply_manifest_after_label_operation( + host.uuid, [lbl_obj.label_key]) except Exception as e: LOG.warn(_("No response vim_api host:%s e=%s" % (host.hostname, e))) diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/platform.py b/sysinv/sysinv/sysinv/sysinv/puppet/platform.py index 1b27de7971..e617631b87 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/platform.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/platform.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2020 Wind River Systems, Inc. +# Copyright (c) 2017-2022 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -553,6 +553,8 @@ class PlatformPuppet(base.BasePuppet): cpu_ranges.update({"nohz_full": isolcpus_ranges}) else: cpu_ranges.update({"nohz_full": rcu_nocbs_ranges}) + else: + cpu_ranges.update({'nohz_full': 'disabled'}) cpu_ranges.update({ "isolcpus": isolcpus_ranges,