Bug 611442 - Unclear error message is seen when try to start a pool with a non-existent source path.
Unclear error message is seen when try to start a pool with a non-existent so...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-05 06:04 EDT by Johnny Liu
Modified: 2011-12-06 05:46 EST (History)
12 users (show)

See Also:
Fixed In Version: libvirt-0.9.4-13.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 05:46:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Johnny Liu 2010-07-05 06:04:11 EDT
Description of problem:
When try to start a pool with a non-existent source path, libvirt throw an error message, but the message is unhelpful for user.

Version-Release number of selected component (if applicable):
libvirt-0.8.1-13.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Define a pool on a mapper device.
# virsh pool-dumpxml xx
<pool type='disk'>
  <name>xx</name>
  <uuid>08a0a104-cbc3-0b96-bd6a-b1f8d00d9474</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <device path='/dev/mapper/mymapper'/>
    <format type='dos'/>
  </source>
  <target>
    <path>/dev</path>
    <permissions>
      <mode>0700</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>
2. List the existent partition on the mapper device.
# ll /dev/mapper/myvm10*
lrwxrwxrwx. 1 root root 7 Jul  5 13:56 /dev/mapper/myvm10 -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul  5 13:56 /dev/mapper/myvm10p1 -> ../dm-1
3. Try to start the pool
# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------    
xx                   inactive   yes       
# virsh pool-start xx
error: Failed to start pool xx
error: internal error non-zero exit status from command 2

  
Actual results:
The error message is unhelpful for user.

Expected results:
Libvirt should prompt the user the pool source path - /dev/mapper/mymapper is not existent.

Additional info:
After I edit pool to correct the pool source path, the pool is started successfully.
# virsh pool-edit xx
Pool xx XML configuration edited.

# virsh pool-dumpxml xx
<pool type='disk'>
  <name>xx</name>
  <uuid>08a0a104-cbc3-0b96-bd6a-b1f8d00d9474</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <device path='/dev/mapper/myvm10'/>
    <format type='dos'/>
  </source>
  <target>
    <path>/dev</path>
    <permissions>
      <mode>0700</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

# virsh pool-start xx
Pool xx started
Comment 2 Daniel Veillard 2010-07-06 04:05:17 EDT
Yeah it's not ideal but I don't think we should fix this at this late stage,
so reschedulng for 6.1,

Daniel
Comment 5 Osier Yang 2011-09-19 23:24:44 EDT
patch committed to upstream.

commit 891c6fd74f1d485ab81eff34b8a15a79528373f1
Author: Osier Yang <jyang@redhat.com>
Date:   Mon Sep 19 15:35:15 2011 +0800

    storage: Ensure the device path exists before refreshing disk pool
    
    Doing libvirt_parthelper on an not existed device path will get
    an unfriendly error message. This patch is to prohibit it.
Comment 13 Huang Wenlong 2011-09-26 03:20:53 EDT
Verify this bug with libvirt-0.9.4-13.el6.x86_64

1. 
# virsh pool-dumpxml xx
<pool type='disk'>
  <name>xx</name>
  <uuid>08a0a104-cbc3-0b96-bd6a-b1f8d00d9474</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <device path='/dev/mapper/mymapper'/>
    <format type='dos'/>
  </source>
  <target>
    <path>/dev</path>
    <permissions>
      <mode>0700</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>


2.
#virsh pool-define pool.xml 
Pool xx defined from pool.xml
3.
# virsh pool-start xx
error: Failed to start pool xx
error: invalid argument: device path '/dev/mapper/mymapper' doesn't exist

4.
# ll /dev/mapper/mymapper
ls: cannot access /dev/mapper/mymapper: No such file or directory
Comment 14 errata-xmlrpc 2011-12-06 05:46:58 EST
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

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