Bug 214913 - virDomainDump() API in libvirt
Summary: virDomainDump() API in libvirt
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-09 22:44 UTC by Lon Hohberger
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: beta2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-12-23 02:27:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to xend to add dump support for the HTTP interface (861 bytes, patch)
2006-11-21 16:54 UTC, 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 17:16 UTC, Daniel Veillard
no flags Details | Diff

Description Lon Hohberger 2006-11-09 22:44:01 UTC
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.

https://www.redhat.com/archives/libvir-list/2006-November/msg00000.html

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 Program Management 2006-11-09 23:00:30 UTC
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
inclusion.

Comment 2 Daniel Veillard 2006-11-16 14:43:35 UTC
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 ,

Daniel

Comment 3 Daniel Veillard 2006-11-21 16:53:06 UTC
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,
enclosed...

Daniel

Comment 4 Daniel Veillard 2006-11-21 16:54:12 UTC
Created attachment 141791 [details]
patch to xend to add dump support for the HTTP interface

Comment 5 Daniel Veillard 2006-11-22 13:56:22 UTC
patch to xend has been accepted upstream, I will now add support in libvirt

http://lists.xensource.com/archives/html/xen-devel/2006-11/msg01121.html

Daniel

Comment 6 Daniel Veillard 2006-11-22 17:16:48 UTC
Created attachment 141920 [details]
patch to add core dump capability to libvirt assuming xend has been patched

Comment 7 Daniel Veillard 2006-11-22 17:19:24 UTC
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);

Daniel

Comment 8 Kiersten (Kerri) Anderson 2006-12-01 19:35:14 UTC
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-07 03:51:51 UTC
QE ack for RHEL5.

Comment 10 Daniel Veillard 2006-12-07 10:23:40 UTC
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,

Daniel


Comment 13 RHEL Program Management 2006-12-23 02:27:45 UTC
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.