Bug 993554 - RFE: Provide a better way to handle transient guests, especially log files
RFE: Provide a better way to handle transient guests, especially log files
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-06 03:32 EDT by Richard W.M. Jones
Modified: 2016-04-19 14:14 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2013-08-06 03:32:43 EDT
Description of problem:

$ ls ~/.cache/libvirt/qemu/log/guestfs-
Display all 20086 possibilities? (y or n)
$ du -sh ~/.cache/libvirt/qemu/log
112M	/home/rjones/.cache/libvirt/qemu/log

$ ls -1 ~/.cache/libvirt/qemu/log | head
dojo.log
guestfs-000a7nn4ahqef70a.log
guestfs-003lpu11p2mn069p.log
guestfs-004zwcxr6ykcjd5u.log
guestfs-00a339l5lwaefwzw.log
guestfs-00budzb5ndk55d1l.log
guestfs-00dbxkm4tm1rhfbu.log
guestfs-00exqu5lto7l2uzn.log
guestfs-00f92gld0jupe0du.log
guestfs-00gqhk2wonma9fon.log

I think there are a couple of issues here:

Firstly these log files have a limited lifespan.  Surely 2 weeks
should be long enough to keep them around, after which they should
be deleted.  Can we put this directory under the control of
systemd-tmpfiles?

Secondly libguestfs wants to make transient guests, but doesn't
particularly need to name them.  Libvirt itself could choose a
random name (or some other mechanism) if there is no <name>
specified in the XML.

Version-Release number of selected component (if applicable):

libvirt-1.0.5.2-1.fc19.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Run libguestfs for a while.
Comment 1 Cole Robinson 2016-04-19 14:14:12 EDT
(In reply to Richard W.M. Jones from comment #0)
> 
> Firstly these log files have a limited lifespan.  Surely 2 weeks
> should be long enough to keep them around, after which they should
> be deleted.  Can we put this directory under the control of
> systemd-tmpfiles?
> 

Personally I like that the log files are long lived, it's helped me with debugging many times. Update libvirt, next time I start the VM qemu doesn't start up, I can look at what changed in the qemu command line output which is occasionally the culprit. And often I don't run certain VMs for months at a time.

But I agree the proliferation of guestfs logs is annoying. libvirt 1.3.3 added a <log file="/var/log/libvirt/qemu/guestname-serial0.log" append="off"/> element to character device XML... maybe repurpose that XML syntax to allow the user to specify a custom logfile location? Then point it to a location private to libguestfs that can be easily cleaned up.

> Secondly libguestfs wants to make transient guests, but doesn't
> particularly need to name them.  Libvirt itself could choose a
> random name (or some other mechanism) if there is no <name>
> specified in the XML.
> 

Sounds interesting. I wouldn't go the full omission of <name> route, but maybe something like <name prefix="guestfs-"/> or some kind of magic like that which will generate a non-colliding name.

This should probably be split into distinct bug reports though, and both those will probably get better response on the mailing list

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