From 5a48ec4d79b994bcf5b35db6dfa94586f72addba Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:29 -0400 Subject: [PATCH] Ensure CPU tuning is only applied on Debian 11+ --- group_vars/default/pvc.yml | 1 + roles/base/defaults/main.yml | 2 +- roles/base/templates/etc/default/grub.j2 | 4 ++++ roles/pvc/tasks/main.yml | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/group_vars/default/pvc.yml b/group_vars/default/pvc.yml index dce1d0c..b19799e 100644 --- a/group_vars/default/pvc.yml +++ b/group_vars/default/pvc.yml @@ -153,6 +153,7 @@ pvc_sriov_enable: False # > ADVANCED TUNING: These options are strongly recommended due to the performance gains possible, but # most users would be able to use the default without too much issue. Read the following notes # carefully to determine if this setting should be enabled in your cluster. +# > NOTE: CPU tuning is only supported on Debian Bullseye (11) or newer # > Defines CPU tuning/affinity options for various subsystems within PVC. This is useful to # help limit the impact that noisy elements may have on other elements, e.g. busy VMs on # OSDs, or system processes on latency-sensitive VMs. diff --git a/roles/base/defaults/main.yml b/roles/base/defaults/main.yml index e56a24f..2611d01 100644 --- a/roles/base/defaults/main.yml +++ b/roles/base/defaults/main.yml @@ -12,7 +12,7 @@ recursive_dns_servers: recursive_dns_search_domains: - "{{ local_domain }}" -grub_cmdline: "systemd.unified_cgroup_hierarchy=1 console=tty0 console=ttyS{{ grub.serial_console[cluster_hardware].console }},115200 plymouth.ignore-serial-consoles splash" +grub_cmdline: "console=tty0 console=ttyS{{ grub.serial_console[cluster_hardware].console }},115200 plymouth.ignore-serial-consoles splash" grub_serial: "serial --unit={{ grub.serial_console[cluster_hardware].console }} --speed=115200" deploy_username: "deploy" diff --git a/roles/base/templates/etc/default/grub.j2 b/roles/base/templates/etc/default/grub.j2 index fd2cfa3..28afa04 100644 --- a/roles/base/templates/etc/default/grub.j2 +++ b/roles/base/templates/etc/default/grub.j2 @@ -3,7 +3,11 @@ GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="PVC Parallel Virtual Cluster - Debian" +{% if ansible_distribution_major_version|int >= 11 %} +GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=1 {{ grub_cmdline }}" +{% else %} GRUB_CMDLINE_LINUX="{{ grub_cmdline }}" +{% endif %} GRUB_TERMINAL_INPUT="console serial" GRUB_TERMINAL_OUTPUT="gfxterm serial" GRUB_SERIAL_COMMAND="{{ grub_serial }}" diff --git a/roles/pvc/tasks/main.yml b/roles/pvc/tasks/main.yml index 74d002a..beaab86 100644 --- a/roles/pvc/tasks/main.yml +++ b/roles/pvc/tasks/main.yml @@ -59,7 +59,7 @@ # Install CPU tuning - include: cputuning/main.yml tags: pvc-cputuning - when: cpu_tuning is defined + when: ansible_distribution_major_version|int >= 11 and cpu_tuning is defined - name: restart server on first install shell: 'sleep 3 && shutdown -r now "Ansible updates triggered"'