From 78625038a2834914a4f4f4defef4568b80c037e9 Mon Sep 17 00:00:00 2001 From: Logan V Date: Fri, 9 Sep 2016 22:14:56 -0500 Subject: [PATCH] Configure qemu when Calico network type is set Previously the qemu.conf was being configured by the Calico tasks in Neutron, which is improper as Neutron is not managing the libvirt/qemu installation. Change-Id: Id2cfa3353543fecd55f1135abad89f07071e2f60 --- tasks/nova_compute_kvm.yml | 4 +++- templates/qemu.conf.j2 | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tasks/nova_compute_kvm.yml b/tasks/nova_compute_kvm.yml index bb6b3688..498e8fa9 100644 --- a/tasks/nova_compute_kvm.yml +++ b/tasks/nova_compute_kvm.yml @@ -47,7 +47,9 @@ owner: "root" group: "root" mode: "0600" - when: qemu_conf_dict is defined + when: + - qemu_conf_dict is defined + or nova_network_type == 'calico' notify: Restart libvirt-bin tags: - nova-kvm diff --git a/templates/qemu.conf.j2 b/templates/qemu.conf.j2 index 9a9934d4..d4d76de1 100644 --- a/templates/qemu.conf.j2 +++ b/templates/qemu.conf.j2 @@ -1,4 +1,20 @@ # {{ ansible_managed }} + +{% if nova_network_type == 'calico' %} +# Calico specific qemu settings +# Information available at: +# http://docs.projectcalico.org/en/latest/ubuntu-opens-install.html +clear_emulator_capabilities = 0 +user = "root" +group = "root" +cgroup_device_acl = [ + "/dev/null", "/dev/full", "/dev/zero", + "/dev/random", "/dev/urandom", + "/dev/ptmx", "/dev/kvm", "/dev/kqemu", + "/dev/rtc", "/dev/hpet", "/dev/net/tun", +] +{% endif %} + {% for key, value in qemu_conf_dict.iteritems() %} {{ key }} = {{ value }} {% endfor %}