From ffb5a74f4f4419f9dd76a78613d9e92d18eb36cb Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Thu, 16 Nov 2023 17:17:41 +0200 Subject: [PATCH] vm-under-test: Permanently disable swap space Disabling swap space since it will introduce potential latency. In order to permanently disable [0], this commit is: - using the swapoff command. - commenting the swap entries on /etc/fstab. - masking the swap service with systemctl (done during the first-boot) [0] https://askubuntu.com/questions/440326/how-can-i-turn-off-swap-permanently/984777#984777 Signed-off-by: Ram Lavi --- vms/vm-under-test/scripts/customize-vm | 3 +++ vms/vm-under-test/scripts/first-boot | 2 ++ 2 files changed, 5 insertions(+) diff --git a/vms/vm-under-test/scripts/customize-vm b/vms/vm-under-test/scripts/customize-vm index 210ed338..9b0cd557 100755 --- a/vms/vm-under-test/scripts/customize-vm +++ b/vms/vm-under-test/scripts/customize-vm @@ -25,3 +25,6 @@ systemctl disable irqbalance dnf --enablerepo=rt install -y tuned-profiles-realtime dnf --enablerepo=nfv install -y tuned-profiles-nfv-guest + +swapoff -a +sed -i '/swap/s/^/#/' /etc/fstab diff --git a/vms/vm-under-test/scripts/first-boot b/vms/vm-under-test/scripts/first-boot index ea0f4203..676c3880 100755 --- a/vms/vm-under-test/scripts/first-boot +++ b/vms/vm-under-test/scripts/first-boot @@ -19,6 +19,8 @@ set -e +systemctl mask "$(systemctl --type swap | grep '.swap' | awk '{print $1}')" + 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