Bug 1004400 - watchdog crash action fails because dump directory not created
Summary: watchdog crash action fails because dump directory not created
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Blake
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1008533
TreeView+ depends on / blocked
 
Reported: 2013-09-04 14:32 UTC by Laszlo Hornyak
Modified: 2014-05-20 13:49 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
: 1008533 (view as bug list)
Environment:
Last Closed: 2013-09-25 15:20:52 UTC
Embargoed:


Attachments (Terms of Use)
libvirt log (210.26 KB, text/x-log)
2013-09-04 15:28 UTC, Laszlo Hornyak
no flags Details
xml definition of the VM (9.96 KB, text/xml)
2013-09-04 15:29 UTC, Laszlo Hornyak
no flags Details

Description Laszlo Hornyak 2013-09-04 14:32:50 UTC
Description of problem:
The default value of auto_dump_path is /var/lib/libvirt/qemu/dump, this directory is not created at installation

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


How reproducible:
always

Steps to Reproduce:
1. yum -y install libvirt
2. ls /var/lib/libvirt/qemu/dump

Actual results:
dump directory is missing

Expected results:
dump directory should exist

Additional info:

Comment 1 Eric Blake 2013-09-04 14:37:23 UTC
Why do you think the directory should be created at installation?  What's wrong with the current behavior of auto-creating it at use time the first time something is actually dumped there?  I see little reason to create an empty directory, when it gets auto-created at the point where it is needed, so I'm inclined to close this as not a bug unless you can explain WHY you want it at installation time.

Comment 2 Laszlo Hornyak 2013-09-04 14:46:21 UTC
I do not really care when is it created, but it was not created when crasing a VM with watchdog set to action=dump

Comment 3 Eric Blake 2013-09-04 14:49:05 UTC
Ah, that makes more sense for why you are raising a bug report.  Can you show actual steps you used for triggering a watchdog crash, and the error message that results when the directory does not exist, in the hopes that it can help someone pinpoint the watchdog code that is not properly auto-creating the directory?

Comment 4 Daniel Berrangé 2013-09-04 14:55:44 UTC
NB, the other general reason for creating dirs at RPM install time, rather than 'mkdir' at runtime is to ensure correct SELinux labelling. Probably doesn't matter here since the label of the default dump dir will match the parent dir anyway, but it is good practice to pre-create the dirs anyway IMHO

Comment 5 Laszlo Hornyak 2013-09-04 15:28:51 UTC
Created attachment 793731 [details]
libvirt log

libvirt log

Comment 6 Laszlo Hornyak 2013-09-04 15:29:41 UTC
Created attachment 793732 [details]
xml definition of the VM

Comment 7 Laszlo Hornyak 2013-09-04 15:39:27 UTC
Steps to Reproduce:
1. create VM with watchdog action=dump
2. run the VM
3. crash the VM
4. wait till watchdog triggered

Actual results:
- Vm goes paused for a few seconds, then it turns back to running state
- no dump found on the local filesystem


Expected results:
- Dump should have been created
- VM should remain in paused mode (unless there is any reason to keep a VM running after it is crashed)

Comment 8 Eric Blake 2013-09-24 22:55:42 UTC
As of at least libvirt 1.1.2 (tested from fedora-virt-preview on Fedora 19):

The /dump directory is auto-created when a GUEST is started (but not when libvirtd itself is started):

# rmdir /var/lib/libvirt/qemu/dump/
# ls /var/lib/libvirt/qemu/
capabilities.monitor.sock  channel  save  snapshot
# systemctl restart libvirtd
# ls /var/lib/libvirt/qemu/
capabilities.monitor.sock  channel  save  snapshot
# virsh start f18-live
Domain f18-live started

# ls /var/lib/libvirt/qemu/
capabilities.monitor.sock  channel  dump  f18-live.monitor  save  snapshot

Normally, you can't do a dump without a running guest, so auto-creating the directory on guest start should be sufficient.  I'm failing to reproduce a failure scenario under my testing.  I'm inclined to close as WORKSFORME unless we can get more details on whether an older libvirt version didn't autocreate the directory; which may include a setup where upgrading libvirtd from an older version that didn't create the directory to a new version that assumes the directory exists without checking it.

Comment 9 Eric Blake 2013-09-25 15:24:42 UTC
The code to auto-create directories has been present since at least commit e123e1e (v0.9.4).  We can reopen this if you can provide more details (what XML did you use for your guest; what version of libvirt did you test); but for now, I'm closing this as upstream does not seem to have a problem.

Comment 10 Richard W.M. Jones 2014-05-20 13:49:14 UTC
I couldn't get watchdog action=dump to do anything at all.
Bug filed here as the symptoms are somewhat different from
the current bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1099514


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