Bug 728835

Summary: lxc guest can not start
Product: Red Hat Enterprise Linux 6 Reporter: Min Zhan <mzhan>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.2CC: ajia, berrange, dallan, dyuan, mzhan, rwu, veillard
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.4-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:23:45 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 Min Zhan 2011-08-08 05:25:50 UTC
Description of problem:
lxc guest can not start 

Version-Release number of selected component (if applicable):
# uname -r
2.6.32-165.el6.x86_64
qemu-kvm-0.12.1.2-2.175.el6.x86_64/qemu-kvm-0.12.1.2-2.176.el6.x86_64
libvirt-0.9.4-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. make sure cgroup is mounted
# lscgroup
cpuset:/
cpuset:/libvirt
cpuset:/libvirt/lxc
cpuset:/libvirt/qemu
cpuset:/libvirt/qemu/rhel5
cpuset:/libvirt/qemu/rhel61
cpu:/
cpu:/libvirt
cpu:/libvirt/lxc
cpu:/libvirt/qemu
cpu:/libvirt/qemu/rhel5
cpu:/libvirt/qemu/rhel5/vcpu0
cpu:/libvirt/qemu/rhel61
cpu:/libvirt/qemu/rhel61/vcpu0
cpuacct:/
cpuacct:/libvirt
cpuacct:/libvirt/lxc
cpuacct:/libvirt/qemu
cpuacct:/libvirt/qemu/rhel5
cpuacct:/libvirt/qemu/rhel61
memory:/
memory:/libvirt
memory:/libvirt/lxc
memory:/libvirt/qemu
memory:/libvirt/qemu/rhel5
memory:/libvirt/qemu/rhel61
devices:/
devices:/libvirt
devices:/libvirt/lxc
devices:/libvirt/qemu
devices:/libvirt/qemu/rhel5
devices:/libvirt/qemu/rhel61
freezer:/
freezer:/libvirt
freezer:/libvirt/lxc
freezer:/libvirt/qemu
freezer:/libvirt/qemu/rhel5
freezer:/libvirt/qemu/rhel61
net_cls:/
blkio:/
blkio:/libvirt
blkio:/libvirt/lxc
blkio:/libvirt/qemu
blkio:/libvirt/qemu/rhel5
blkio:/libvirt/qemu/rhel61

2. prepare guest xml
# cat toy.xml
<domain type='lxc'>
  <name>vm1</name>
  <uuid>386f5b25-43ee-9d62-4ce2-58c3809e47c1</uuid>
  <memory>500000</memory>
  <currentMemory>500000</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <interface type='network'>
      <mac address='52:54:00:f2:2c:ac'/>
      <source network='default'/>
      <target dev='veth0'/>
    </interface>
    <console type='pty'>
      <target port='0'/>
    </console>
  </devices>
</domain>

3. start the guest
# virsh -c lxc:///
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # define toy.xml
Domain vm1 defined from toy.xml

virsh # list --all
 Id Name                 State
----------------------------------
  - vm1                  shut off

virsh # start vm1
error: Failed to start domain vm1
error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux LIBVIRT_LXC_UUID=386f5b25-43ee-9d62-4ce2-58c3809e47c1 LIBVIRT_LXC_NAME=vm1 /bin/sh
11:17:26.260: 1: info : libvirt version: 0.9.4, package: 1.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-08-03-02:08:40, x86-001.build.bos.redhat.com)
11:17:26.260: 1: error : getDevNull:265 : cannot open /dev/null: No such file or directory
11:17:26.260: 1805: info : libvirt version: 0.9.4, package: 1.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-08-03-02:08:40, x86-001.build.bos.redhat.com)
11:17:26.260: 1805: error : lxcControllerRun:760 : error receiving signal from container: Success

virsh # list --all
 Id Name                 State
----------------------------------
  - vm1                  shut off

  
Actual results:
As above

Expected results:
guest can start well.

Additional info:
1. no related log in /var/log/messages. 

# /var/log/libvirt/lxc/vm1.log
2011-08-07 11:47:53.840: starting up
PATH=/sbin:/usr/sbin:/bin:/usr/bin LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name vm1 --console 17 --handshake 25 --background --veth veth1
PATH=/bin:/sbin TERM=linux LIBVIRT_LXC_UUID=386f5b25-43ee-9d62-4ce2-58c3809e47c1 LIBVIRT_LXC_NAME=vm1 /bin/sh
11:47:53.896: 1: info : libvirt version: 0.9.4, package: 1.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-08-03-02:08:40, x86-001.build.bos.redhat.com)
11:47:53.896: 1: error : getDevNull:265 : cannot open /dev/null: No such file or directory
11:47:53.896: 9342: info : libvirt version: 0.9.4, package: 1.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-08-03-02:08:40, x86-001.build.bos.redhat.com)
11:47:53.896: 9342: error : lxcControllerRun:760 : error receiving signal from container: Success

2. It does not exist in libvirt-0.9.3-8.el6 and libvirt-0.9.3-7.el6. So it is a regression. Also this bug will block most lxc testing.

Test in libvirt-0.9.3-7.el6:

virsh # start vm1
Domain vm1 started

virsh # exit

# virsh -c lxc:/// console vm1
Connected to domain vm1
Escape character is ^]
sh-4.1# ls
bin        dev   images  lost+found  mnt  proc  selinux  tmp
boot        etc   lib     media          net  root  srv      usr
cgroup        home  lib64   misc          opt  sbin  sys      var
sh-4.1# exit
exit

Comment 2 Daniel Veillard 2011-08-08 07:30:12 UTC
Please test with libvirt-0.9.4-1.el6, not the old 0.9.3 builds and report,

thanks,

Daniel

Comment 3 Daniel Veillard 2011-08-08 07:34:13 UTC
ah, got confused, it was with 0.9.4, okay

Daniel

Comment 4 Daniel Berrangé 2011-08-08 09:32:49 UTC
We need to pull in this patch from upstream

https://www.redhat.com/archives/libvir-list/2011-August/msg00210.html

Comment 7 dyuan 2011-08-09 10:22:52 UTC
Verified PASS with libvirt-0.9.4-2.el6.
pkgs:
qemu-kvm-0.12.1.2-2.177.el6
kernel-2.6.32-178.el6

Comment 8 errata-xmlrpc 2011-12-06 11:23:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1513.html