On Thu, Oct 08, 2015 at 01:29:04PM +0200, Jiri Denemark wrote:
On Thu, Oct 08, 2015 at 12:08:58 +0100, Daniel P. Berrange wrote:
> On Thu, Oct 08, 2015 at 12:06:09PM +0100, Richard W.M. Jones wrote:
> >
> > I wonder if there's a reason why it is not possible to dump the core
> > of a KVM domain which is set to autodestroy.
> >
> > $ virsh dump guestfs-4xe592eyqq4rfnk9 /tmp/guestfs-4xe592eyqq4rfnk9.core
> > error: Failed to core dump domain guestfs-4xe592eyqq4rfnk9 to
/tmp/guestfs-4xe592eyqq4rfnk9.core
> > error: Requested operation is not valid: domain is marked for auto destroy
> >
> > All libguestfs domains have the autodestroy flag, but I am trying to
> > debug one which is crashing in the guest (RHBZ#1269779) and having the
> > ability to dump it would be very helpful.
> >
> > I added the following patch to libvirt, which allowed me to dump the
> > domain with no apparent ill effects.
>
> Yep, I see no reason to block use of the core dump API. Looking at the
> patch I think this is probably just an over-sight - ie it is merely
> blocked as an accidental side-effect of us blocking migration.
I think you should actually use virsh dump --memory-only ... to go
through dump-guest-memory instead of migration. This should create an
elf formated core which crash supports better and even on ppc64, for
example.
Apparently not on aarch64 however:
$ ~/d/libvirt/run ~/d/libvirt/tools/virsh dump --memory-only guestfs-b1rs92hpq4izkpvi
/tmp/guestfs-b1rs92hpq4izkpvi.core
error: Failed to core dump domain guestfs-b1rs92hpq4izkpvi to
/tmp/guestfs-b1rs92hpq4izkpvi.core
error: internal error: unable to execute QEMU command 'dump-guest-memory': this
feature or command is not currently supported
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/