Bug 769752

Summary: Fail to start LXC guest
Product: Red Hat Enterprise Linux 6 Reporter: Rita Wu <rwu>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, ajia, berrange, cwei, dallan, dyuan, eblake, mzhan, whuang
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.9-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:39:48 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 Rita Wu 2011-12-22 04:48:08 UTC
Description of problem:
Fail to start LXC guest

Version-Release number of selected component (if applicable):
# rpm -qa|grep libvirt
libvirt-debuginfo-0.9.8-1.el6.x86_64
libvirt-devel-0.9.8-1.el6.x86_64
libvirt-client-0.9.8-1.el6.x86_64
libvirt-0.9.8-1.el6.x86_64
libvirt-python-0.9.8-1.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Define a LXC guest
# cat single_toy.xml 
<domain type='lxc'>
  <name>single_toy</name>
  <uuid>386f5b25-43ee-9d62-4ce2-62c3809e47c1</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'>
      <source network='default'/>
    </interface>
    <console type='pty'>
      <target port='0'/>
    </console>
  </devices>
</domain>

# virsh -c lxc:/// define single_toy.xml 
Domain single_toy defined from single_toy.xml


2. Start the LXC guest 
# virsh -c lxc:/// start single_toy
error: Failed to start domain single_toy
error: internal error guest failed to start: 2011-12-22 02:44:08.576+0000: 17944: info : libvirt version: 0.9.8, package: 1.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-12-08-10:01:37, x86-008.build.bos.redhat.com)
2011-12-22 02:44:08.576+0000: 17944: error : lxcControllerRun:1393 : unsupported configuration: Expected exactly one TTY fd
  
Actual results:
as step2 mentioned

Expected results:
Start LXC successfully.

Additional info:
it works with libvirt-0.9.4-23.el6.x86_64, so mark it as Regression

Comment 2 Dave Allan 2011-12-22 17:11:41 UTC
Dan, does this look familiar?

Comment 3 Daniel Berrangé 2011-12-22 17:50:59 UTC
Fix upstream

commit 4d82fa688ee4a1d30013e8b3be0151f2c4deace1
Author: Daniel P. Berrange <berrange>
Date:   Thu Dec 8 14:57:13 2011 +0000

    When checking nttyFDs to see if it is != 1, be sure to use '1' and not '-1'
    
    * src/lxc/lxc_controller.c: Fix check for tty count

Comment 5 Alex Jia 2012-01-10 10:07:49 UTC
The issue has been fixed on libvirt-0.9.9-1.el6.x86_64:

# virsh -c lxc:/// define toy.xml 
Domain toy defined from toy.xml

# virsh -c lxc:/// start toy
Domain toy started

# virsh -c lxc:/// list
 Id Name                 State
----------------------------------
24091 toy                  running

Comment 6 Alex Jia 2012-02-13 05:38:03 UTC
For libvirt-0.9.10-0rc2.el6.x86_64, you will meet the following known issue:

# virsh -c lxc:/// start toy
error: Failed to start domain toy
error: internal error Child process (PATH=/sbin:/usr/sbin:/bin:/usr/bin LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name toy --console 48 --handshake 51 --background --veth veth1) status unexpected: exit status 1

The above issue has been fixed on upstream:

commit d474dbaddebfce8a2f6cfc4d2c4a9c50c2fab6df
Author: Daniel P. Berrange <berrange>
Date:   Wed Feb 8 14:21:28 2012 +0000

    Populate /dev/std{in,out,err} symlinks in LXC containers
    
    Some applications expect /dev/std{in,out,err} to exist. Populate
    them during container startup as symlinks to /proc/self/fd

Comment 7 dyuan 2012-02-17 06:48:09 UTC
(In reply to comment #6)
> For libvirt-0.9.10-0rc2.el6.x86_64, you will meet the following known issue:
> 
> # virsh -c lxc:/// start toy
> error: Failed to start domain toy
> error: internal error Child process (PATH=/sbin:/usr/sbin:/bin:/usr/bin
> LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name
> toy --console 48 --handshake 51 --background --veth veth1) status unexpected:
> exit status 1
> 
> The above issue has been fixed on upstream:
> 
> commit d474dbaddebfce8a2f6cfc4d2c4a9c50c2fab6df
> Author: Daniel P. Berrange <berrange>
> Date:   Wed Feb 8 14:21:28 2012 +0000
> 
>     Populate /dev/std{in,out,err} symlinks in LXC containers
> 
>     Some applications expect /dev/std{in,out,err} to exist. Populate
>     them during container startup as symlinks to /proc/self/fd

It works fine with libvirt-0.9.10-1.el6 now.

Comment 8 Huang Wenlong 2012-03-07 05:16:37 UTC
I can reproduce this bug in RHEL7 

libvirt-0.9.7-3.el7.x86_64
qemu-kvm-0.15.1-3.2.el7.x86_64

add comment to track this bug ,we will test it again after RHEL7 libvirt upgrade to 0.9.10 from 0.9.7 .

Wenlong

Comment 10 errata-xmlrpc 2012-06-20 06:39:48 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/RHSA-2012-0748.html