This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 769752 - Fail to start LXC guest
Fail to start LXC guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-21 23:48 EST by Rita Wu
Modified: 2013-07-02 21:44 EDT (History)
9 users (show)

See Also:
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 02:39:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Rita Wu 2011-12-21 23:48:08 EST
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 12:11:41 EST
Dan, does this look familiar?
Comment 3 Daniel Berrange 2011-12-22 12:50:59 EST
Fix upstream

commit 4d82fa688ee4a1d30013e8b3be0151f2c4deace1
Author: Daniel P. Berrange <berrange@redhat.com>
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 05:07:49 EST
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 00:38:03 EST
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@redhat.com>
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 01:48:09 EST
(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@redhat.com>
> 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 00:16:37 EST
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 02:39:48 EDT
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

Note You need to log in before you can comment on or make changes to this bug.