From 55be5746305fbf3799535b2072e941ca8f7901e4 Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Thu, 26 Oct 2017 10:06:45 -0400 Subject: [PATCH] Explicitly disable KSM by default on Ubuntu. By default KSM is enabled on Ubuntu, disabling it specificaly. Change-Id: I689a851c5268db70e04564386952945fe5612cb0 --- .../notes/disable-ksm-670aeb175826b7ca.yaml | 5 +++++ tasks/drivers/kvm/nova_compute_kvm.yml | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/disable-ksm-670aeb175826b7ca.yaml diff --git a/releasenotes/notes/disable-ksm-670aeb175826b7ca.yaml b/releasenotes/notes/disable-ksm-670aeb175826b7ca.yaml new file mode 100644 index 00000000..cd7b61cd --- /dev/null +++ b/releasenotes/notes/disable-ksm-670aeb175826b7ca.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - KSM configuration is changed to disabled by default on Ubuntu. + if you overcommit the RAM on your hypervisor it's a good + idea to set ``nova_compute_ksm_enabled`` to True. diff --git a/tasks/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index 6067648c..fdc2e685 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -113,6 +113,20 @@ - nova-kvm - nova-libvirt +- name: Set qemu-kvm KSM config (Ubuntu) + lineinfile: + dest: "/etc/default/qemu-kvm" + line: "KSM_ENABLED={{ nova_compute_ksm_enabled | ternary('1','0') }}" + regexp: "^KSM_ENABLED=*" + backup: yes + when: + - ansible_pkg_mgr == 'apt' + notify: Restart libvirt-bin + tags: + - nova-config + - nova-kvm + - nova-libvirt + - include: nova_disable_smt.yml when: - ansible_architecture == 'ppc64le'