Bug 34170 - Increase libvirtd verbose debug output
Increase libvirtd verbose debug output
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Virtualization - UVMM
UCS 3.2
All Linux
: P5 enhancement (vote)
: UCS 3.2-1-errata
Assigned To: Erik Damrose
Philipp Hahn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-21 10:30 CET by Philipp Hahn
Modified: 2014-04-03 14:15 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-02-21 10:30:54 CET
By default libvirtd in UCS logs nothing.
Important messages are only logged to STDERR and collected by runsvdir:
  ps www `pidof runsvdir`

We should enable more logging by default and optionally make it configurable through UCR to help our support team to collect useful error information.

RedHat has this <https://bugzilla.redhat.com/show_bug.cgi?id=1061753> for /etc/libvirt/libvirtd.conf as recently discussed on libvirt-devel:
 log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util"
 log_outputs="1:file:/var/log/libvirt/libvirtd.log"
Comment 1 Erik Damrose univentionstaff 2014-03-17 17:17:12 CET
We can set an overall log level in libvirt.conf (4 different levels) and increase log granularity with the log_filters option to increase or lower log messages from different subsystems. 

Todo: test different scenarios to obtain useful default log levels.

In addition, it should be checked if similar options will be made configurable for uvmm-daemon, which uses the libvirt library functions.
Comment 2 Philipp Hahn univentionstaff 2014-03-25 11:09:15 CET
FYI: log_filter only works on whole C files, not on a individual function name level:
> src/util/virlog.c:828
>  fprio = virLogFiltersCheck(filename, &filterflags);
So for libvirtd its mostly daemon/remote.c.
Plus the indirectly called files src/qemu/qemu_*.c, src/xen/*.c, src/xenxs/*.c.
Comment 3 Erik Damrose univentionstaff 2014-04-01 11:38:34 CEST
Three new ucr variables are introduced in this fix:
libvirt/log/level, libvirt/log/filters, libvirt/log/outputs

By default, only errors will be logged to /var/lib/libvirt/libvirtd.log

r48929 univention-virtual-machine-manager-node 2.0.5-6.77.201404011119
r48930 2014-03-14-univention-virtual-machine-manager-node.yaml

When a new uvmm-daemon connection is established to a uvmm-node-xen, the following messages are logged. They are harmless, as xen does not support snapshots, but we test it anyway (in Node.update_once()).

<timestamp><pid> error : virDomainHasManagedSaveImage:16930 : this function is not supported by the connection driver: virDomainHasManagedSaveImage                                                                                               
<timestamp><pid> error : virDomainSnapshotNum:17304 : this function is not supported by the connection driver: virDomainSnapshotNum
Comment 4 Erik Damrose univentionstaff 2014-04-01 14:33:11 CEST
Updated UCR variable descriptions as suggested

r48946 univention-virtual-machine-manager-node 2.0.5-7.78.201404011429
updated yaml file
Comment 5 Philipp Hahn univentionstaff 2014-04-01 18:15:06 CEST
FIXED: r48929+48946 spelling mistakes
OK: r48930+48948 2014-03-14-univention-virtual-machine-manager-node.yaml
OK: aptitude install '?source-package(univention-virtual-machine-manager-node)?installed'
OK: 2.0.5-7.78.201404011429
OK: ucr set libvirt/log/level=2
OK: ucr set libvirt/log/filters='4:event 3:remote'
OK: ucr set libvirt/log/outputs="1:file:/var/log/libvirt/libvirtd.log 2:file:/var/log/libvirt/libvirtd.info"
OK: announce_errata -V 2014-03-14-univention-virtual-machine-manager-node.yaml
Comment 6 Moritz Muehlenhoff univentionstaff 2014-04-03 14:15:28 CEST
http://errata.univention.de/ucs/3.2/79.html