From 1d2ab2b84104dfbe76c08e66e1d7dd715cbd3fa5 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 11 Feb 2020 15:40:22 +0100 Subject: [PATCH] Fix and add logs and info This patch fixes collection of logs adding sudo to commands that need that. Also adds collection of some more useful info for libvirt and qemu, for example increasing the log verbosity of libvirt. Reordered commands to divide them by section. Change-Id: I86ae0dac8de63449405012a99ddf94f915b304b0 --- .../tasks/prepare_libvirt.yml | 7 +++++++ scripts/collect-test-info.sh | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml index d83d35720..278779220 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml @@ -40,6 +40,13 @@ - lxml when: enable_venv | default(false) | bool +- name: configure libvirt log filters for qemu + blockinfile: + path: /etc/libvirt/libvirtd.conf + block: | + log_filters="1:qemu 1:libvirt 4:object 4:json 4:event 1:util" + log_outputs="1:file:/var/log/libvirt/libvirtd.log" + - name: "Restart libvirt service" service: name="{{libvirt_service_name}}" state=restarted diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index 9ad662455..76e1f1ff5 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -86,11 +86,21 @@ if [ -d "/var/log/ironic" ]; then ls -la ${LOG_LOCATION}/ipa-logs fi -sudo vbmc list &> ${LOG_LOCATION}/vbmc.txt -sudo virsh list --all &> ${LOG_LOCATION}/virsh-list.txt +# general info +sudo ps auxf &> ${LOG_LOCATION}/ps.txt +sudo lscpu > ${LOG_LOCATION}/lscpu.txt +# vbmc info +sudo ${VENV}/bin/vbmc list &> ${LOG_LOCATION}/vbmc.txt +# virsh info TEST_VM=$(sudo virsh list --all --name | head -1) +sudo virsh list --all &> ${LOG_LOCATION}/virsh_list.txt sudo virsh dumpxml ${TEST_VM} > ${LOG_LOCATION}/${TEST_VM}_dump.xml -ps auxf &> ${LOG_LOCATION}/ps.txt +sudo virsh capabilities > ${LOG_LOCATION}/virsh_capabilities.txt +sudo virsh domcapabilities > ${LOG_LOCATION}/virsh_domcapabilities.txt +# libvirt info +sudo cp /usr/share/libvirt/cpu_map.xml ${LOG_LOCATION}/libvirt_cpu_map.xml +sudo cp /etc/libvirt/libvirtd.conf ${LOG_LOCATION}/libvirtd.conf +sudo cp /var/log/libvirt/libvirtd.log ${LOG_LOCATION}/libvirtd_debug.log sudo chown -R $USER ${LOG_LOCATION} # In CI scenarios, we want other users to be able to read the logs.