Bug 214913 - virDomainDump() API in libvirt
virDomainDump() API in libvirt
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
Depends On:
  Show dependency treegraph
Reported: 2006-11-09 17:44 EST by Lon Hohberger
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: beta2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-12-22 21:27:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to xend to add dump support for the HTTP interface (861 bytes, patch)
2006-11-21 11:54 EST, Daniel Veillard
no flags Details | Diff
patch to add core dump capability to libvirt assuming xend has been patched (10.91 KB, patch)
2006-11-22 12:16 EST, Daniel Veillard
no flags Details | Diff

  None (edit)
Description Lon Hohberger 2006-11-09 17:44:01 EST
Description of problem:  In order to debug reasons why a node must be fenced in
a cluster (or any situation where a domain needs to be killed immediately), it
would be beneficial to dump a core of the domain out to disk.


There's already one for saving live domains:

int virDomainSave(virDomainPtr domain, const char *to);

It would be nice to have one which does the equivalent of 'xm dump-core':

int virDomainDump(virDomainPtr domain, const char *to, int flags);

Create a kernel dump of the domain in the path contained in *to.  This
API must fail if the domain is not in a panicked/crashed state.

Initially (optionally, as well), the only flag which is honored is a bit
which causes the domain to be crashed prior to taking the dump (so that,
even if the domain is healthy, you can force a dump/panic).  The idea is
that this would work in the same way as an administrator hitting
Alt-SysRq-C and taking a dump afterwards.

Implementation discussion is in the above mailing list, which is incorporated
herein only by reference.
Comment 1 RHEL Product and Program Management 2006-11-09 18:00:30 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
Comment 2 Daniel Veillard 2006-11-16 09:43:35 EST
It seems the dump-core support of xend is wired on the XML-RPC back-end that
xm uses to communicate 
   XendDomain::domain_dump() in xen/xend/XendDomain.py
but not available though the HTTP POST :
   SrvDomain::op_dump() doesn't exist in server/SrvDomain.py

I'm still investigating but I'm afraid this would require either patching our
xen package with a non-upstream extension or extend libvirt to add support for
that temporary xml-rpc solution in xen-3.0.2 and 3.0.3 ,

Comment 3 Daniel Veillard 2006-11-21 11:53:06 EST
The patch needed to extend xend support of the dump option for the HTTP 
access method is very simple based on other entry points and seems to work,

Comment 4 Daniel Veillard 2006-11-21 11:54:12 EST
Created attachment 141791 [details]
patch to xend to add dump support for the HTTP interface
Comment 5 Daniel Veillard 2006-11-22 08:56:22 EST
patch to xend has been accepted upstream, I will now add support in libvirt


Comment 6 Daniel Veillard 2006-11-22 12:16:48 EST
Created attachment 141920 [details]
patch to add core dump capability to libvirt assuming xend has been patched
Comment 7 Daniel Veillard 2006-11-22 12:19:24 EST
The patch above has been commited to libvirt upstream, i.e. both patches needed
for this functionality are upstream,
The new routine is:
   virDomainCoreDump(virDomainPtr domain, const char *to, int flags);

Comment 8 Kiersten (Kerri) Anderson 2006-12-01 14:35:14 EST
Would like to get this interface into RHEL5.0, will greatly help solve customer
problems found with clustering of xen guests.
Comment 9 Jay Turner 2006-12-06 22:51:51 EST
QE ack for RHEL5.
Comment 10 Daniel Veillard 2006-12-07 05:23:40 EST
xen-3.0.3-13.el5 and libvirt-0.1.8-5.el5 have been pushed and include the
2 patches, the server side one in xen and the client one in libvirt. There
is also a new 'dump' command to virsh allowing to test the feature from
the command line (as root and after making sure it's the new xend running):

[root@paphio ~]# rm -rf /xen/rhel5.dump
[root@paphio ~]# virsh dump rhel5 /xen/rhel5.dump
Domain rhel5 dumpd to /xen/rhel5.dump

[root@paphio ~]# ls -l /xen/rhel5.dump
-rw------- 1 root root 403779584 Dec  7 11:29 /xen/rhel5.dump
[root@paphio ~]# 

  the dump takes a few seconds, and the size of the resulting core is a bit
larger than the memory size of the domain,

Comment 13 RHEL Product and Program Management 2006-12-22 21:27:45 EST
A package has been built which should help the problem described in 
this bug report. This report is therefore being closed with a resolution 
of CURRENTRELEASE. You may reopen this bug report if the solution does 
not work for you.

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