From 792ab7147117f9665f88bad831796e9a5110b9d5 Mon Sep 17 00:00:00 2001 From: Bertrand Lallau Date: Mon, 28 Aug 2017 10:36:05 +0200 Subject: [PATCH] Fluentd: Libvirt logs are missing Libvirt logs are not managed by Fluentd. It can be very helpful to debug 'booting' issue on KVM. Change-Id: Ie04322adec0482f4d586d2f8564a1a77f2da2605 Closes-Bug: #1713429 --- ansible/roles/common/tasks/config.yml | 1 + .../common/templates/conf/input/05-libvirt.conf.j2 | 10 ++++++++++ ansible/roles/common/templates/fluentd.json.j2 | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 ansible/roles/common/templates/conf/input/05-libvirt.conf.j2 diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 8eccc94f20..62cd12862c 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -34,6 +34,7 @@ - "02-mariadb" - "03-rabbitmq" - "04-openstack-wsgi" + - "05-libvirt" notify: - Restart fluentd container diff --git a/ansible/roles/common/templates/conf/input/05-libvirt.conf.j2 b/ansible/roles/common/templates/conf/input/05-libvirt.conf.j2 new file mode 100644 index 0000000000..c4fb4c8179 --- /dev/null +++ b/ansible/roles/common/templates/conf/input/05-libvirt.conf.j2 @@ -0,0 +1,10 @@ +{% set fluentd_dir = 'td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else 'fluentd' %} + + @type tail + path /var/log/kolla/libvirt/libvirtd.log + pos_file /var/run/{{ fluentd_dir }}/libvirt.pos + tag infra.libvirt + format /^(?\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}\+\d{4}): (?\d+): (?\S+) : (?.*)?$/ + time_key Timestamp + time_format %F %T.%L%z + diff --git a/ansible/roles/common/templates/fluentd.json.j2 b/ansible/roles/common/templates/fluentd.json.j2 index b72dd226c8..97c72b69a0 100644 --- a/ansible/roles/common/templates/fluentd.json.j2 +++ b/ansible/roles/common/templates/fluentd.json.j2 @@ -41,6 +41,12 @@ "owner": "{{ fluentd_user }}", "perm": "0600" }, + { + "source": "{{ container_config_directory }}/input/05-libvirt.conf", + "dest": "{{ fluentd_dir }}/input/05-libvirt.conf", + "owner": "{{ fluentd_user }}", + "perm": "0600" + }, { "source": "{{ container_config_directory }}/filter/00-record_transformer.conf", "dest": "{{ fluentd_dir }}/filter/00-record_transformer.conf",