From 4cc6ed4b481d59f7765333b78c6aaf1015bd56aa Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: 2021年3月30日 13:14:24 +0300 Subject: [PATCH] Set default qemu settings for RBD When Nova and/or Cinder are using Ceph as backend, qemu will need to open a connection and two threads for each and every Ceph OSD. Since all connections occur in the same qemu process, this may result in hitting default max open files limit. Thus in case of more then 10 volumes are attached to the same instance and are used actively can end up in blocked IO operations inside VMs. We increase these limits by default when RBD backend is used. Change-Id: Ib3081280cdbae1eb2235083c95c27e2efd0b413e --- defaults/main.yml | 2 +- tasks/drivers/kvm/nova_compute_kvm.yml | 2 +- templates/qemu.conf.j2 | 5 ++--- vars/main.yml | 10 ++++++++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index a2cc5193..1a57b9f4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -491,7 +491,7 @@ nova_qemu_group: kvm # Define the following variable to drop a replacement # file for /etc/libvirt/qemu.conf -#qemu_conf_dict: {} +qemu_conf_dict: {} ## Tunable overrides nova_nova_conf_overrides: {} diff --git a/tasks/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index c03036fe..b27aed8c 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -100,7 +100,7 @@ group: "root" mode: "0600" when: - - qemu_conf_dict is defined + - _nova_qemu_conf | length> 0 or nova_network_type == 'calico' notify: Restart libvirt-bin tags: diff --git a/templates/qemu.conf.j2 b/templates/qemu.conf.j2 index 6e513567..914afec2 100644 --- a/templates/qemu.conf.j2 +++ b/templates/qemu.conf.j2 @@ -15,8 +15,7 @@ cgroup_device_acl = [ ] {% endif %} -{% if qemu_conf_dict is defined %} -{% for key, value in qemu_conf_dict.items() %} + +{% for key, value in _nova_qemu_conf.items() %} {{ key }} = {{ value }} {% endfor %} -{% endif %} diff --git a/vars/main.yml b/vars/main.yml index ebfa11c0..cfb8f5b6 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -104,3 +104,13 @@ _nova_scheduler_filters: |- {% set filters = default_filters %} {% endif %} {{ filters + nova_scheduler_extra_filters }} + +_qemu_default_conf_dict: |- + {% set qemu_dict = {} %} + {% if nova_rbd_inuse or nova_cinder_rbd_inuse %} + {% set _ = qemu_dict.update({'max_files': '32768'}) %} + {% set _ = qemu_dict.update({'max_processes': '131072'}) %} + {% endif %} + {{ qemu_dict }} + +_nova_qemu_conf: "{{ _qemu_default_conf_dict | combine(qemu_conf_dict) }}"

AltStyle によって変換されたページ (->オリジナル) /