From 74d590c778bb1a3fa96cb07c73d726624a68df19 Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Thu, 16 Nov 2023 17:16:37 +0200 Subject: [PATCH] vm-under-test: Set CPU/tuned configurations The tuned-adm command needs a reboot in order to take effect. In order to reboot during the virt-builder operation - the command is done in a first-boot script. Signed-off-by: Ram Lavi --- vms/vm-under-test/scripts/build-vm-image | 1 + vms/vm-under-test/scripts/first-boot | 26 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 vms/vm-under-test/scripts/first-boot diff --git a/vms/vm-under-test/scripts/build-vm-image b/vms/vm-under-test/scripts/build-vm-image index 1ee56fc8..c1cdced6 100755 --- a/vms/vm-under-test/scripts/build-vm-image +++ b/vms/vm-under-test/scripts/build-vm-image @@ -24,5 +24,6 @@ virt-builder centosstream-8 \ --root-password password:redhat \ --install cloud-init,kernel-rt,tuned,rt-tests \ --run /root/scripts/customize-vm \ + --firstboot /root/scripts/first-boot \ --selinux-relabel \ --output /output/kubevirt-realtime-checkup-vm.qcow2 diff --git a/vms/vm-under-test/scripts/first-boot b/vms/vm-under-test/scripts/first-boot new file mode 100755 index 00000000..ea0f4203 --- /dev/null +++ b/vms/vm-under-test/scripts/first-boot @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# This file is part of the kiagnose project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Copyright 2023 Red Hat, Inc. +# + +set -e + +echo isolated_cores=1-2 >> /etc/tuned/realtime-virtual-guest-variables.conf +echo isolate_managed_irq=Y >> /etc/tuned/realtime-virtual-guest-variables.conf +tuned-adm profile realtime-virtual-guest + +reboot