Bug 707801

Summary: Fail to shutdown lxc guest
Product: [Community] Virtualization Tools Reporter: zhanghaiyan <yoyzhang>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: unspecifiedCC: crobinso, cwei, dyuan, jtomko, mshao, mzhan, techtonik, tools-bugs, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-17 14:48:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description zhanghaiyan 2011-05-26 02:12:52 UTC
Description of problem:
Failed to shutdown lxc guest

Version-Release number of selected component (if applicable):
libvirt-0.9.1-1.el6.x86_64
kernel-2.6.32-131.0.15.el6.x86_64
qemu-kvm-0.12.1.2-2.162.el6.x86_64

How reproducible:
3/3

Steps to Reproduce:
1. virsh # define vm1.xml 
Domain fedora-rawhide defined from vm1.xml
2. virsh # start fedora-rawhide
Domain fedora-rawhide started
virsh # list --all
 Id Name                 State
----------------------------------
28251 fedora-rawhide       running
3. virsh # shutdown fedora-rawhide
error: Failed to shutdown domain fedora-rawhide
error: this function is not supported by the connection driver: virDomainShutdown
virsh # list --all
 Id Name                 State
----------------------------------
28251 fedora-rawhide       running
4. virsh # destroy fedora-rawhide
Domain fedora-rawhide destroyed

virsh # list --all
 Id Name                 State
----------------------------------
  - fedora-rawhide       shut off

Actual results:
In step3, failed to shutdown the guest while can destroy the guest

Expected results:
Should be able to shutdown the lxc guest as before

Additional info:
It is a regression bug

Comment 2 Osier Yang 2011-05-30 09:34:37 UTC
LXC driver has never supported domain shutdown, so this shouldn't be a regression.

Comment 6 Ján Tomko 2015-03-17 14:48:51 UTC
Added upstream by:
commit cbb106f807b32f1f6af22d1e92fe0ff9ba6d73b3
Author:     Daniel P. Berrange <berrange>
AuthorDate: 2012-11-28 13:26:52 +0000
Commit:     Daniel P. Berrange <berrange>
CommitDate: 2012-11-30 19:20:14 +0000

    Add support for shutdown / reboot APIs in LXC driver
    
    Add support for doing controlled shutdown / reboot in the LXC
    driver. The default behaviour is to try talking to /dev/initctl
    inside the container's virtual root (/proc/$INITPID/root). This
    works with sysvinit or systemd. If that file does not exist
    then send SIGTERM (for shutdown) or SIGHUP (for reboot). These
    signals are not any kind of particular standard for shutdown
    or reboot, just something apps can choose to handle. The new
    virDomainSendProcessSignal allows for sending custom signals.
    
    We might allow the choice of SIGTERM/HUP to be configured for
    LXC containers via the XML in the future.
    
    Signed-off-by: Daniel P. Berrange <berrange>

git describe: v1.0.0-204-gcbb106f contains: v1.0.1-rc1~113