Bug 604852

Summary: when on_crash is set to "coredump-restart", virsh and libvirt API complain unknown lifecycle type and some functions no longer work
Product: [Community] Virtualization Tools Reporter: Tom <xiaohm>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: unspecifiedCC: crobinso, jtomko, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-28 14:33:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom 2010-06-16 20:39:22 UTC
Description of problem:

After we edited Xen configuration file for a VM to dump core when the VM crashes, we noticed that some virsh commands, such as "virsh dumpxml" or "virsh console", start to display following errors and cannot work properly.

# virsh dumpxml linuxvm
error: internal error unknown lifecycle type coredump-restart

We observed this problem in libvirt-0.7.6-1. We believe other versions should have similiar issue. 


How reproducible:


Steps to Reproduce:
1. create a PV VM named "linuxvm"
2. edit /etc/xen/linuxvm by adding following line
  on_crash = "coredump-restart"
3. execute "xm create linuxvm" to recreate the VM.
4. after linux started, run following command,
   # virsh dumpxml linuxm
  
Actual results:

error: internal error unknown lifecycle type coredump-restart

Expected results:

'dumpxml' should display xml on the screen as expected.

Additional info:

Besides "dumpxml", we also noticed "console" doesn't work properly. We didn't test other command also we believe some other virsh command could be affected, too. Also, seems like some underlying libvirt API is broken by this as well. 

Is there any workaround solution for this problem?

Comment 1 Tom 2010-06-17 13:17:26 UTC
There is a workaround for this problem. Set the on_crash="preserve" for a VM. After the VM crashed, a coredump will be generated automatically and the VM will be kept and its status will be "crashed". A deamon process can be used to detect this status and then restart it. 

(In reply to comment #0)

> Description of problem:
> After we edited Xen configuration file for a VM to dump core when the VM
> crashes, we noticed that some virsh commands, such as "virsh dumpxml" or "virsh
> console", start to display following errors and cannot work properly.
> # virsh dumpxml linuxvm
> error: internal error unknown lifecycle type coredump-restart
> We observed this problem in libvirt-0.7.6-1. We believe other versions should
> have similiar issue. 
> How reproducible:
> Steps to Reproduce:
> 1. create a PV VM named "linuxvm"
> 2. edit /etc/xen/linuxvm by adding following line
>   on_crash = "coredump-restart"
> 3. execute "xm create linuxvm" to recreate the VM.
> 4. after linux started, run following command,
>    # virsh dumpxml linuxm
> Actual results:
> error: internal error unknown lifecycle type coredump-restart
> Expected results:
> 'dumpxml' should display xml on the screen as expected.
> Additional info:
> Besides "dumpxml", we also noticed "console" doesn't work properly. We didn't
> test other command also we believe some other virsh command could be affected,
> too. Also, seems like some underlying libvirt API is broken by this as well. 
> Is there any workaround solution for this problem?

Comment 2 Ján Tomko 2015-07-28 14:33:24 UTC
Fixed upstream by:
commit b9c10268e14b5f6a8a405813406964ccade67fcb
Author:     Jim Fehlig <jfehlig>
AuthorDate: 2010-08-12 11:15:44 -0600
Commit:     Eric Blake <eblake>
CommitDate: 2010-08-20 15:06:30 -0600

    Add actions to virDomainLifecycle enum
    
    Xen supports on_crash actions coredump-{destroy,restart}.  libvirt
    cannot parse config returned by xend that contains either of these
    actions
    
    xen52 # xm li -l test | grep on_crash
        (on_crash coredump-restart)
    xen52 # virsh dumpxml test
    error: internal error unknown lifecycle type coredump-restart
    
    This patch adds a new virDomainLifecycleCrash enum and appends
    the new options to existing destroy, restart, preserve, and
    rename-restart options.

git describe: v0.8.3-65-gb9c1026 contains: v0.8.4~62