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 927072 - Improve the error msg when start the container failed due to the source dir is missing
Summary: Improve the error msg when start the container failed due to the source dir i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 966361 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-25 02:57 UTC by dyuan
Modified: 2014-06-18 00:45 UTC (History)
9 users (show)

Fixed In Version: libvirt-1.1.1-9.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:28:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description dyuan 2013-03-25 02:57:24 UTC
Description of problem:
1. Improve the error msg when start the container failed due to the source dir is missing
2. Start the container without any error msg in virsh cmd but failed actually.


Version-Release number of selected component (if applicable):
libvirt-1.0.3-1.el7
selinux-policy-3.12.1-18.el7
kernel-3.8.0-0.42.el7

How reproducible:
always

Steps to Reproduce:
1. # virsh -c lxc:/// dumpxml sandbox
<domain type='lxc'>
  <name>sandbox</name>
  <uuid>fdc5d804-7a9b-51b0-1d0f-1313f1d4c1df</uuid>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/usr/libexec/libvirt-sandbox-init-lxc</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>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
      <readonly/>
    </filesystem>
******
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/var/run/libvirt-sandbox/sandbox/config'/>
      <target dir='/etc/libvirt-sandbox/scratch'/>
      <readonly/>
    </filesystem>
    <filesystem type='bind' accessmode='passthrough'>
      <source dir='/tmp/home'/>
      <target dir='/home/redhat'/>
    </filesystem>
******
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
    <console type='pty'>
      <target type='lxc' port='1'/>
    </console>
  </devices>
  <seclabel type='static' model='selinux' relabel='no'>
    <label>system_u:system_r:virtd_lxc_t:s0:c0.c1023</label>
  </seclabel>
</domain>

2. Start the container without any corresponding directories on host.
# virsh -c lxc:/// start sandbox
error: Failed to start domain sandbox
error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux container=lxc-libvirt container_uuid=fdc5d804-7a9b-51b0-1d0f-1313f1d4c1df LIBVIRT_LXC_UUID=fdc5d804-7a9b-51b0-1d0f-1313f1d4c1df LIBVIRT_LXC_NAME=sandbox /usr/libexec/libvirt-sandbox-init-lxc
2013-03-25 02:40:28.968+0000: 1622: info : libvirt version: 1.0.3, package: 1.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2013-03-05-04:25:15, x86-019.build.eng.bos.redhat.com)
2013-03-25 02:40:28.968+0000: 1622: error : virLXCControllerRun:1468 : error receiving signal from container: Input/output error

3. If start the guest with only the following filesystem element in <device>
     <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
      <readonly/>
    </filesystem>
  
4. Start the guest without error msg but failed actually
# virsh -c lxc:/// start sandbox
Domain sandbox started

# virsh -c lxc:/// list --all
 Id    Name                           State
----------------------------------------------------
 -     sandbox                        shut off

5. And I can get the error in libvirtd.log.
2013-03-25 02:46:01.437+0000: 881: error : virNetSocketReadWire:1324 : End of file while reading data: Input/output error

Actual results:


Expected results:
Improve the error msg in step2.
Should pop error msg in step4.


Additional info:

Comment 2 Daniel Berrangé 2013-10-14 12:10:30 UTC
One further set of improvements

https://www.redhat.com/archives/libvir-list/2013-October/msg00577.html

Comment 4 Daniel Berrangé 2013-10-15 10:01:17 UTC
*** Bug 966361 has been marked as a duplicate of this bug. ***

Comment 6 Luwen Su 2013-10-21 07:37:54 UTC
Test:
libvirt-1.1.1-9.el7.x86_64
systemd-207-4.el7.x86_64
kernel-3.10.0-34.el7.x86_64

1.For the first part , which xml include doesn't exit dir , like
 <filesystem type='mount' accessmode='passthrough'>
      <source dir='/var/run/libvirt-sandbox/sandbox/config'/>
      <target dir='/etc/libvirt-sandbox/scratch'/>
      <readonly/>
 </filesystem>

# virsh -c lxc:/// start sandbox
error: Failed to start domain sandbox
error: internal error: guest failed to start: Failed to access '/var/run/libvirt-sandbox/sandbox/config': No such file or directory

That's expected through the patches.


2.For the second part , which xml only include 
<filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
      <readonly/>
</filesystem>

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

# virsh -c lxc:/// list --all
 Id    Name                           State
----------------------------------------------------
 -     only                           shut off

# virsh -c lxc:/// destroy only
error: Failed to destroy domain only
error: Requested operation is not valid: Domain is not running

in logs:
Oct 21 15:30:32 localhost systemd: Starting Container lxc-only.
Oct 21 15:30:32 localhost systemd-machined: New machine lxc-only.
Oct 21 15:30:32 localhost systemd: Started Container lxc-only.
Oct 21 15:30:33 localhost systemd-machined: Machine lxc-only terminated.


Further more , the default lxc that created by virt-manager has limited difference with the lxc only

12c12
<     <init>/usr/libexec/libvirt-sandbox-init-lxc</init>
---
>     <init>/bin/sh</init>
17c17
<   <on_crash>destroy</on_crash>
---
>   <on_crash>restart</on_crash>
23d22
<       <readonly/>
25c24,30
<     <console type='pty'>
---
>     <interface type='network'>
>       <mac address='00:16:3e:b7:a5:86'/>
>       <source network='default'/>
>       <target dev='vnet0'/>
>     </interface>
>     <console type='pty' tty='/dev/pts/1'>
>       <source path='/dev/pts/1'/>
27,29c32
<     </console>
<     <console type='pty'>
<       <target type='lxc' port='1'/>
---
>       <alias name='console0'/>
32,34c35
<   <seclabel type='static' model='selinux' relabel='no'>
<     <label>system_u:system_r:virtd_lxc_t:s0:c0.c1023</label>
<   </seclabel>
---
>   <seclabel type='none' model='selinux'/>



Should i file another bug for this issue ?

Comment 7 Daniel Berrangé 2014-01-29 10:57:50 UTC
Yes, please file a new bug - from your first test case it appears the issue from this bug is resolved already.

Comment 8 Luwen Su 2014-02-21 07:18:33 UTC
Per comment 5 and 7 , i created Bug 1067804 and verify this one

Comment 9 Ludek Smid 2014-06-13 11:28:45 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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