Bug 1061753 - [RFE] Create an option in packstack to increase verbosity level of libvirt
Summary: [RFE] Create an option in packstack to increase verbosity level of libvirt
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RDO
Classification: Community
Component: openstack-packstack
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: RHOS Maint
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-05 14:47 UTC by Yogev Rabl
Modified: 2017-06-18 05:57 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-18 05:57:54 UTC
lars: needinfo-


Attachments (Terms of Use)

Description Yogev Rabl 2014-02-05 14:47:15 UTC
Description of problem:
The libvirt default configuration doesn't write logs, the whole section in /etc/libvirt/libvirtd.conf is commented out. 

Version-Release number of selected component (if applicable):
openstack-packstack-2013.2.1-0.29.dev956.fc20.noarch

libvirt-daemon-driver-network-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-storage-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-lxc-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-vbox-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-xen-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-qemu-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-nodedev-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-uml-1.1.3.3-2.fc20.x86_64
libvirt-python-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-libxl-1.1.3.3-2.fc20.x86_64
libvirt-client-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-secret-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-interface-1.1.3.3-2.fc20.x86_64
libvirt-daemon-config-nwfilter-1.1.3.3-2.fc20.x86_64
libvirt-1.1.3.3-2.fc20.x86_64
libvirt-daemon-1.1.3.3-2.fc20.x86_64
libvirt-daemon-driver-nwfilter-1.1.3.3-2.fc20.x86_64
libvirt-daemon-kvm-1.1.3.3-2.fc20.x86_64
libvirt-daemon-config-network-1.1.3.3-2.fc20.x86_64

How reproducible:
100%

Comment 1 Kashyap Chamarthy 2014-02-05 17:43:17 UTC
Short: NOTABUG

Long:

Even though the configuration looks empty, the *default* log_level is 3,
i.e. warnings and errors, this is redirected to to systemd journal (on
systems that are run systemd, and to syslog on older systems). You can
notice this when you invoke:

   $ systemctl status libvirtd
    libvirtd.service - Virtualization daemon
       Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
       Active: active (running) since Wed 2014-02-05 22:45:05 IST; 11s ago
     Main PID: 32521 (libvirtd)
       CGroup: /system.slice/libvirtd.service
               ├─  821 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
               └─32521 /usr/sbin/libvirtd

    Feb 05 22:45:05 foohost.com systemd[1]: Started Virtualization daemon.
    Feb 05 22:45:06 foohost.com dnsmasq[821]: read /etc/hosts - 2 addresses
    Feb 05 22:45:06 foohost.com dnsmasq[821]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
    Feb 05 22:45:06 foohost.com dnsmasq-dhcp[821]: read /var/lib/libvirt/dnsmasq/default.hostsfile


Furthermore, there's a couple of different ways to enable various log
levels based on filters, etc.

- If you want logs to be redirected to a file, that can be expressed in
  /etc/libvirt/libvirtd.conf. 

   To log _everything_ (this spews LOTS of details, fills up your disk),
   add these 

        log_level = 1
        log_outputs = 1:file:/var/tmp/libvirtd.log

   to /etc/libvirt/libvirtd.conf, restart libvirtd.

- Alternatively, you can set environment variables (if set, this will
  take precedence over values specified in the configuration file):

    $ export LIBVIRT_DEBUG=1
    $ export  LIBVIRT_TRACE=1

More extensive details on logging filters are available here:

     http://libvirt.org/logging.html

Comment 2 Kashyap Chamarthy 2014-02-05 17:47:44 UTC
Yogev, can you clarify if you intended to make "packstack" to enable 
more elaborate libvirt logging other than the default (which is warnings
and errors).

Comment 3 Daniel Berrangé 2014-02-05 18:05:07 UTC
You absolutely don't ever want to set LIBVIRT_DEBUG env var or log_level settings. The amount of data these generate destroys performance and is impossible to find the meaningul info in the GBs of irrelevant junk.

IMHO libvirt log level should be upto the host admin to decide upon.

Comment 4 Perry Myers 2014-02-05 18:31:11 UTC
I'm going to change the $subj of this bugzilla to see if it makes it more palatable to folks.

We could expose a new config option to packstack (cmdline/conf file) that allows you to have packstack increase the verbosity level of libvirt if you set it.  But it would always be a manual option to use that packstack flag/config option, and by default libvirt would use it's default logging verbosity settings

Comment 5 Dafna Ron 2014-02-05 18:54:44 UTC
just to add that I disagree with Dan. 
1. currently, no libvirt log is created during installation and it used to do that in the past so something has changed.  
2. ovirt libvirt logs are in debug level and rotates the logs. keeping it in debug is helpful to dev/qe/gss and users. 
3. it's better to have libvirt events logged because not all events can be reproduced like they do in devel environment. 
4. an admin can decided to remove any log but if we configure logging of cinder/glance/nova and so on, why would we not log libvirt which is an important component? if the admin decides to stop debugging it it's their problem.

Comment 6 Kashyap Chamarthy 2014-02-05 21:35:36 UTC
(In reply to Dafna Ron from comment #5)
> just to add that I disagree with Dan. 

A related debate happened recently, upstream, to revert a DevStack change that made 'log_level=1' (in the end, it was reverted to a more fine-grained filters).

  http://lists.openstack.org/pipermail/openstack-dev/2014-January/024414.html

Quoting DanpB:
'''
  it is complete insanity to set 'log_level=1' on *any* hosts.
  The level of debug info that generates is so enourmous that you'd
  never wanted to look at it. Debugging from that would be like trying
  to find a specific piece of hay in a haystack. That original devstack
  change should just be completely reverted.

  It would be useful if Jenkins machines had an elevated log level,
  but even there you definitely don't want to set log_level=1. I
  would suggest that for Jenkin's machines *only* we want to try

     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"
'''

> 1. currently, no libvirt log is created during installation and it used to
> do that in the past so something has changed.  

Two things

 - You can do "tail -f foo.log" style monitoring, by default, this way:

        $  journalctl -f --unit=libvirtd

 - And, Some amount of guest specific logs go  /var/log/libvirt/qemu/guest.log


> 2. ovirt libvirt logs are in debug level and rotates the logs. keeping it in
> debug is helpful to dev/qe/gss and users. 

In my experience, more specific, targeted log filtering was helpful to narrow down issues.

> 3. it's better to have libvirt events logged because not all events can be
> reproduced like they do in devel environment. 

As you can notice above, "event" layer logs (and several other layers -
QEMU, util, security) can be easily configured.

> 4. an admin can decided to remove any log but if we configure logging of
> cinder/glance/nova and so on, why would we not log libvirt which is an
> important component? if the admin decides to stop debugging it it's their
> problem.

Even for Cinder/Glance, etc - VERBOSE/DEBUG  are not enabled by default you need to explicitly enable them.

I think you're saying you need a log file to be present by default with no need for explicit configuration -- that seems reasonably fair.

Comment 7 Daniel Berrangé 2014-02-06 10:28:56 UTC
(In reply to Dafna Ron from comment #5)
> just to add that I disagree with Dan. 
> 1. currently, no libvirt log is created during installation and it used to
> do that in the past so something has changed.  

All logs go to the systemd journal by default now - syslog is being gracefully retired from life.

> 2. ovirt libvirt logs are in debug level and rotates the logs. keeping it in
> debug is helpful to dev/qe/gss and users. 

NB ovirt doesn't enable full libvirt debug level afaik - just some tailored subset - if it does that is very bad because it has a truely awful performance impact.

> 3. it's better to have libvirt events logged because not all events can be
> reproduced like they do in devel environment. 

'event' is an overloaded word - please clarify what you mean by "events" in this context

> 4. an admin can decided to remove any log but if we configure logging of
> cinder/glance/nova and so on, why would we not log libvirt which is an
> important component? if the admin decides to stop debugging it it's their
> problem.

IME it is sufficient to ask for specific debug options to be enabled at the time they're actually required, rather than having it turned on permanently. Taking logs at time of need means we can tailor the info collected to match what we actually need.

Comment 8 Dafna Ron 2014-02-06 10:38:55 UTC
(In reply to Daniel Berrange from comment #7)
> (In reply to Dafna Ron from comment #5)
> > just to add that I disagree with Dan. 
> > 1. currently, no libvirt log is created during installation and it used to
> > do that in the past so something has changed.  
> 
> All logs go to the systemd journal by default now - syslog is being
> gracefully retired from life.

libvirtd.log was always created under /var/log/libvirt/ (until now). 
> 
> > 2. ovirt libvirt logs are in debug level and rotates the logs. keeping it in
> > debug is helpful to dev/qe/gss and users. 
> 
> NB ovirt doesn't enable full libvirt debug level afaik - just some tailored
> subset - if it does that is very bad because it has a truely awful
> performance impact.

I checked last night on an rhevm setup and logs are in debug (no one changed it manually, it's deployed in debug as it always have). 

> 
> > 3. it's better to have libvirt events logged because not all events can be
> > reproduced like they do in devel environment. 
> 
> 'event' is an overloaded word - please clarify what you mean by "events" in
> this context

event -> when a domain dies/fails to be migrated or any issue that involves the instances (qemu logs don't always have enough info). 

> 
> > 4. an admin can decided to remove any log but if we configure logging of
> > cinder/glance/nova and so on, why would we not log libvirt which is an
> > important component? if the admin decides to stop debugging it it's their
> > problem.
> 
> IME it is sufficient to ask for specific debug options to be enabled at the
> time they're actually required, rather than having it turned on permanently.
> Taking logs at time of need means we can tailor the info collected to match
> what we actually need.

Comment 9 Daniel Berrangé 2014-02-06 10:47:22 UTC
(In reply to Dafna Ron from comment #8)
> (In reply to Daniel Berrange from comment #7)
> > (In reply to Dafna Ron from comment #5)
> > > just to add that I disagree with Dan. 
> > > 1. currently, no libvirt log is created during installation and it used to
> > > do that in the past so something has changed.  
> > 
> > All logs go to the systemd journal by default now - syslog is being
> > gracefully retired from life.
> 
> libvirtd.log was always created under /var/log/libvirt/ (until now). 

That's on legacy RHEL-6 platforms. On Fedora / RHEL-7 systemd journal is the preferred approach for any logging in the future because it gives you well structured data which can be more easily analysed/queried that plain text log files. Syslog / plain text logs are something to be avoided in any default configuration.

Comment 10 Dafna Ron 2014-02-06 11:04:57 UTC
binary logs are for developers :) what about the rest of us?

Comment 11 Daniel Berrangé 2014-02-06 11:21:19 UTC
(In reply to Dafna Ron from comment #10)
> binary logs are for developers :) what about the rest of us?

The journalctl tool for querying the logs displays them in plain text just fine.

Comment 12 Dafna Ron 2014-02-06 11:26:12 UTC
(In reply to Daniel Berrange from comment #11)
> (In reply to Dafna Ron from comment #10)
> > binary logs are for developers :) what about the rest of us?
> 
> The journalctl tool for querying the logs displays them in plain text just
> fine.

I read some discussions on line that there are performance issues with it. 
but I think we are digressing here :) if Red Hat has decided to go towards systemd journal I think this is important information for future testing and support.

Adding Yaniv.

Comment 13 Kashyap Chamarthy 2014-02-06 16:38:27 UTC
(In reply to Dafna Ron from comment #12)
> (In reply to Daniel Berrange from comment #11)
> > (In reply to Dafna Ron from comment #10)
> > > binary logs are for developers :) what about the rest of us?
> > 
> > The journalctl tool for querying the logs displays them in plain text just
> > fine.
> 
> I read some discussions on line that there are performance issues with it. 

Honestly, I wouldn't make "some discussions on line" as a basis to
conclude there are "performance issues" without any systematic
measurement to back it up with numbers.

> but I think we are digressing here :) if Red Hat has decided to go towards
> systemd journal I think this is important information for future testing and
> support.

[a] systemd journal already _is_ part of RHEL7:

    https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7-Beta/html/System_Administrators_Guide/s1-Using_the_Journal.html


[b] From Fedora-20 and above, traditional syslog service will not be 
even _installed_ (you would have noticed there's no /var/log/messages
file on your F20 machine)

    https://fedoraproject.org/wiki/Changes/NoDefaultSyslog


(Finally, I redact my incorrect statement in a previous commentthat it's 
a reasonable request to ask for a default libvirt log file. Thanks Dan,
for correcting.)

Comment 14 Martin Magr 2014-02-10 11:19:43 UTC
I agree with  Daniel and Kashyap. Using journalctl is pretty straightforward and even QE should learn it. 

Nevertheless it seems that there are some people who need to run libvirtd in debug mode ( or complete insanity mode as was stated above :) ), so we can implement a special switch just for one service to run in debug mode (WITH BIG RED WARNING of course). But this is definitely not an urgent thing ...

Comment 15 Lars Kellogg-Stedman 2015-03-20 18:48:24 UTC
Patch proposed upstream:

https://review.openstack.org/#/c/166345/

Comment 18 Christopher Brown 2017-06-17 19:55:27 UTC
I think this can be closed as WONTFIX/NOTABUG or even

"How I learned to stop worrying and love the systemd"


Note You need to log in before you can comment on or make changes to this bug.