Bug 1004400 - watchdog crash action fails because dump directory not created
watchdog crash action fails because dump directory not created
Status: CLOSED WORKSFORME
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Eric Blake
:
Depends On:
Blocks: 1008533
  Show dependency treegraph
 
Reported: 2013-09-04 10:32 EDT by Laszlo Hornyak
Modified: 2014-05-20 09:49 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1008533 (view as bug list)
Environment:
Last Closed: 2013-09-25 11:20:52 EDT
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)
libvirt log (210.26 KB, text/x-log)
2013-09-04 11:28 EDT, Laszlo Hornyak
no flags Details
xml definition of the VM (9.96 KB, text/xml)
2013-09-04 11:29 EDT, Laszlo Hornyak
no flags Details

  None (edit)
Description Laszlo Hornyak 2013-09-04 10:32:50 EDT
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 10:37:23 EDT
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 10:46:21 EDT
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 10:49:05 EDT
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 Berrange 2013-09-04 10:55:44 EDT
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 11:28:51 EDT
Created attachment 793731 [details]
libvirt log

libvirt log
Comment 6 Laszlo Hornyak 2013-09-04 11:29:41 EDT
Created attachment 793732 [details]
xml definition of the VM
Comment 7 Laszlo Hornyak 2013-09-04 11:39:27 EDT
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 18:55:42 EDT
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 11:24:42 EDT
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 09:49:14 EDT
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.