tenks/roles/tenks-diagnostics/files/dump_libvirt_logs.sh
Will Szumski b4bc89dfff Add a zuul job to deploy and teardown a tenks cluster
This stops short of enrolling the nodes in Ironic, but provides
some coverage of the earlier stages.

Change-Id: I48a0bafaff1555caea0a7d216ac6f6a4f11c2b55
Depends-On: https://review.openstack.org/#/c/615544/
Depends-On: https://review.openstack.org/#/c/616510/
Depends-On: https://review.openstack.org/#/c/616501/
2018-11-08 16:21:21 +00:00

27 lines
567 B
Bash

#!/bin/bash
# This script will query libvirt to get some information useful for
# debugging
# Environment variables:
# $LOG_DIR is the directory to copy logs to.
# $CONFIG_DIR is the directory to copy configuration from.
set +o errexit
copy_logs() {
if ! command -v virsh > /dev/null 2>&1; then
return 0
fi
virsh list --all > ${LOG_DIR}/libvirt_logs/list.txt
virsh list --all --name | while read vm; do
if [ "$vm" != "" ]; then
virsh dumpxml "$vm" > ${LOG_DIR}/libvirt_logs/"$vm".txt
fi
done
}
copy_logs