RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 857341 - fail to start lxc domain
Summary: fail to start lxc domain
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-14 07:16 UTC by yanbing du
Modified: 2013-02-21 07:23 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.10.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:23:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Internal Links: 995897

Description yanbing du 2012-09-14 07:16:30 UTC
Description of problem:
Fail to start LXC guest.

Version-Release number of selected component (if applicable):
libvirt-0.10.1-2.el6.x86_64
kernel-2.6.32-303.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Define a LXC guest
# cat toy.xml
<domain type='lxc'>
  <name>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 toy.xml
Domain toy defined from toy.xml


2. Start the LXC guest
 # start toy
error: Failed to start domain toy
error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux container=lxc-libvirt container_uuid=386f5b25-43ee-9d62-4ce2-62c3809e47c1 LIBVIRT_LXC_UUID=386f5b25-43ee-9d62-4ce2-62c3809e47c1 LIBVIRT_LXC_NAME=toy /bin/sh
2012-09-14 07:06:00.613+0000: 1: info : libvirt version: 0.10.1, package: 2.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2012-09-13-00:00:13, x86-009.build.bos.redhat.com)
2012-09-14 07:06:00.613+0000: 1: error : lxcContainerMountBasicFS:560 : Failed to mount /selinux on /selinux type selinuxfs: Device or resource busy
2012-09-14 07:06:00.620+0000: 6317: info : libvirt version: 0.10.1, package: 2.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2012-09-13-00:00:13, x86-009.build.bos.redhat.com)
2012-09-14 07:06:00.620+0000: 6317: error : virLXCControllerRun:1420 : Unable to send container continue message: Broken pipe


  
Actual results:
Fail to start

Expected results:
libvirt-0.10.1-2.e

Additional info:
libvirtd.log
------
2012-09-14 07:06:00.646+0000: 6169: info : libvirt version: 0.10.1, package: 2.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2012-09-13-00:00:13, x86-009.build.bos.redhat.com)
2012-09-14 07:06:00.646+0000: 6169: error : virNetSocketReadWire:1176 : Cannot recv data: Connection reset by peer
2012-09-14 07:06:00.745+0000: 6174: error : virLXCProcessStart:1145 : internal error guest failed to start: PATH=/bin:/sbin TERM=linux container=lxc-libvirt container_uuid=386f5b25-43ee-9d62-4ce2-62c3809e47c1 LIBVIRT_LXC_UUID=386f5b25-43ee-9d62-4ce2-62c3809e47c1 LIBVIRT_LXC_NAME=toy /bin/sh
2012-09-14 07:06:00.613+0000: 1: info : libvirt version: 0.10.1, package: 2.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2012-09-13-00:00:13, x86-009.build.bos.redhat.com)
2012-09-14 07:06:00.613+0000: 1: error : lxcContainerMountBasicFS:560 : Failed to mount /selinux on /selinux type selinuxfs: Device or resource busy
2012-09-14 07:06:00.620+0000: 6317: info : libvirt version: 0.10.1, package: 2.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2012-09-13-00:00:13, x86-009.build.bos.redhat.com)
2012-09-14 07:06:00.620+0000: 6317: error : virLXCControllerRun:1420 : Unable to send container continue message: Broken pipe

2012-09-14 07:06:00.755+0000: 6174: error : virNetDevSetOnline:538 : Cannot get interface flags on 'veth0': No such device
2012-09-14 07:06:00.835+0000: 6169: error : virLXCProcessStop:701 : internal error Invalid PID -1 for container
2012-09-14 07:06:00.835+0000: 6169: error : virLXCProcessStop:701 : internal error Invalid PID -1 for container

Comment 2 yanbing du 2012-09-14 08:06:18 UTC
As it works on libvirt-0.9.10-21.el6.x86_64, so mark this bug a regression bug.

Comment 4 Daniel Berrangé 2012-09-14 16:37:00 UTC
Ok this is a very peculiar error that I've never seen before

> 2012-09-14 07:06:00.613+0000: 1: error : lxcContainerMountBasicFS:560 : Failed > to mount /selinux on /selinux type selinuxfs: Device or resource busy

Comment 5 Daniel Berrangé 2012-09-17 16:27:33 UTC
I've been able to reproduce this locally on RHEL-6 box, but not on rawhide. So there must be some difference, perhaps in the libselinux behaviour

Comment 6 Daniel Berrangé 2012-09-21 10:18:34 UTC
Fixed upstream

commit c15d893252e8000d26a33813027edde38e1b6912
Author: Daniel P. Berrange <berrange>
Date:   Tue Sep 18 12:25:56 2012 +0100

    Ensure existing selinux mount is removed before mounting new one in LXC
    
    Some kernel versions (at least RHEL-6 2.6.32) do not let you over-mount
    an existing selinuxfs instance with a new one. Thus we must unmount the
    existing instance inside our namespace.

Comment 7 Jiri Denemark 2012-09-21 10:21:23 UTC
This issue is now fixed upstream by v0.10.2-rc2-2-gc15d893:

commit c15d893252e8000d26a33813027edde38e1b6912
Author: Daniel P. Berrange <berrange>
Date:   Tue Sep 18 12:25:56 2012 +0100

    Ensure existing selinux mount is removed before mounting new one
    in LXC
    
    Some kernel versions (at least RHEL-6 2.6.32) do not let you
    over-mount an existing selinuxfs instance with a new one. Thus we
    must unmount the existing instance inside our namespace.

Comment 8 Wayne Sun 2012-09-25 03:34:40 UTC
pkgs:
libvirt-0.10.2-1.el6.x86_64
kernel-2.6.32-279.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.313.el6.x86_64

steps:
Following steps in description:
# virsh -c lxc:/// list --all
 Id    Name                           State
----------------------------------------------------
 -     vm1                            shut off

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

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

virsh # start vm1
Domain vm1 started

virsh # list
 Id    Name                           State
----------------------------------------------------
 30672 vm1                            running

virsh # dumpxml vm1
<domain type='lxc' id='30672'>
  <name>vm1</name>
  <uuid>386f5b25-43ee-9d62-4ce2-58c3809e47c1</uuid>
  <memory unit='KiB'>500000</memory>
  <currentMemory unit='KiB'>500000</currentMemory>
  <vcpu placement='static'>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' tty='/dev/pts/8'>
      <source path='/dev/pts/8'/>
      <target type='lxc' port='0'/>
      <alias name='console0'/>
    </console>
  </devices>
  <seclabel type='none'/>
</domain>

virsh # destroy vm1
Domain vm1 destroyed


This is working now.

Comment 9 errata-xmlrpc 2013-02-21 07:23:54 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-2013-0276.html


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