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
This commit is contained in:
Riccardo Pittau 2020-02-11 15:40:22 +01:00
parent 5f9ba09c5e
commit 1d2ab2b841
2 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -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.