Bug 509979 - Command 'virsh find-storage-pool-sources' : error: Unknown failure
Command 'virsh find-storage-pool-sources' : error: Unknown failure
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
5.4
All Linux
low Severity medium
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
:
Depends On:
Blocks: 573552
  Show dependency treegraph
 
Reported: 2009-07-07 05:10 EDT by zhanghaiyan
Modified: 2010-03-30 04:10 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 573552 (view as bug list)
Environment:
Last Closed: 2010-03-30 04:10:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Backport of upstream changeset (1.10 KB, text/plain)
2009-12-09 12:18 EST, Cole Robinson
no flags Details

  None (edit)
Description zhanghaiyan 2009-07-07 05:10:38 EDT
Description of problem:
Command 'virsh find-storage-pool-sources' failed to find any dir/nfs/netfs pool sources, and have unknown failure error

Version-Release number of selected component (if applicable):
- libvirt-0.6.3-13.el5
- RHEL5.4-Xen / KVM
- kvm-83-83.el5
- kernel-xen-2.6.18-156.el5

How reproducible:
100%

Steps to Reproduce:
1. Issue command
   # virsh find-storage-pool-sources dir
2. Issue command
   # virsh find-storage-pool-sources nfs
3. Issue command
   # virsh find-storage-pool-sources netfs
  
Actual results:
1. error: Failed to find any dir pool sources
   error: Unknown failure
2. error: Failed to find any nfs pool sources
   error: Unknown failure
3. error: Failed to find any netfs pool sources
   error: XML description for bad <source> spec is not well formed or invalid


Expected results:
Discover potential storage pool sources, and return source xml document
Comment 1 Hugh Brock 2009-10-30 11:51:02 EDT
Cole, can we pull in the upstream error reporting fixes you committed recently?
Comment 2 Cole Robinson 2009-12-09 11:56:06 EST
Commit is here:

http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=e3f5dbcdf01040f44188fa9d32c1a1ead0216444

Should be a simple backport.
Comment 3 Cole Robinson 2009-12-09 12:18:00 EST
Created attachment 377248 [details]
Backport of upstream changeset

Upstream cset applies fine (after pointing to old storage_driver path) and builds fine).
Comment 4 Daniel Veillard 2009-12-15 10:48:01 EST
libvirt-0.6.3-25.el5 has been built in dist-5E-qu-candidate with the fix,

Daniel
Comment 6 Alex Jia 2009-12-29 03:49:34 EST
This bug still exist.

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 ~]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5xen #1 SMP Mon Dec 21 18:46:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 ~]# rpm -qa|grep libvirt
libvirt-0.6.3-25.el5
libvirt-python-0.6.3-25.el5
libvirt-debuginfo-0.6.3-25.el5
[root@dhcp-66-70-62 ~]# rpm -qa|grep xen
xen-libs-3.0.3-102.el5
xen-devel-3.0.3-102.el5
kmod-gnbd-xen-0.1.5-2.el5
kmod-gfs-xen-0.1.34-9.el5
xen-3.0.3-102.el5
xen-libs-3.0.3-102.el5
kernel-xen-2.6.18-183.el5
kmod-cmirror-xen-0.1.22-3.el5


Steps to Reproduce:
[root@dhcp-66-70-62 libvirt]# virsh pool-list --all
Name                 State      Autostart
-----------------------------------------
dirpool              active     no

[root@dhcp-66-70-62 libvirt]# virsh pool-dumpxml dirpool
<pool type='dir'>
  <name>dirpool</name>
  <uuid>4bddc9df-0403-73b5-9fb9-fa980cd4d741</uuid>
  <capacity>40618147840</capacity>
  <allocation>12185968640</allocation>
  <available>28432179200</available>
  <source>
  </source>
  <target>
    <path>/var/lib/xen/images</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

[root@dhcp-66-70-62 libvirt]# virsh find-storage-pool-sources dir
error: Failed to find any dir pool sources
error: this function is not supported by the hypervisor: pool type 'dir' does not support source discovery

[root@dhcp-66-70-62 libvirt]# virsh pool-dumpxml dirpool > dirpool.xml
[root@dhcp-66-70-62 libvirt]# virsh find-storage-pool-sources dir dirpool.xml
error: Failed to find any dir pool sources
error: this function is not supported by the hypervisor: pool type 'dir' does not support source discovery


[root@dhcp-66-70-62 libvirt]# cat pool-netfs.xml
<pool type='netfs'>
  <name>nfspool</name>
  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/libvirt1/auto'/>
    <format type='nfs'/>
  </source>
  <target>
    <path>/var/lib/libvirt/images</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

[root@dhcp-66-70-62 libvirt]# virsh pool-create pool-netfs.xml
Pool nfsimages created from pool-netfs.xml

[root@dhcp-66-70-62 libvirt]# virsh pool-list --all
Name                 State      Autostart
-----------------------------------------
dirpool              active     no
nfspool            active     no

[root@dhcp-66-70-62 libvirt]# virsh find-storage-pool-sources netfs
error: Failed to find any netfs pool sources
error: XML description for bad <source> spec is not well formed or invalid
Comment 7 Cole Robinson 2010-01-04 11:22:26 EST
The above failures are all expected. find-storage-pool-sources-* only works for types 'logical' and 'netfs'. The xml passed to find-storage-pool-sources should be a pool <source> block like (for netfs pool):

<source><host name='foobar.com'/></source>

So it appears this bug is fixed, and comment #6 lists expected behavior.
Comment 8 Alex Jia 2010-01-05 01:33:39 EST
logical type storage pool can't be created correctly,it block me to further verify.I has reported the following bug.
https://bugzilla.redhat.com/show_bug.cgi?id=552452

Steps to Reproduce:
1.netfs type storage pool is successful.
[root@dhcp-66-70-62 libvirt]# cat pool-netfs.xml
<pool type='netfs'>
  <name>nfspool</name>
  <uuid>7641d5a8-af11-f730-a34e-0a7dfcede71f</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/libvirt1/auto'/>
    <format type='nfs'/>
  </source>
  <target>
    <path>/var/lib/libvirt/images</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

[root@dhcp-66-70-62 storagepoolschemadata]# virt-xml-validate pool-netfs.xml 
pool-netfs.xml validates

[root@dhcp-66-70-62 ~]# virsh pool-create pool-netfs.xml
Pool nfspool created from pool-netfs.xml

[root@dhcp-66-70-62 ~]# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
nfspool              active     no        

[root@dhcp-66-70-62 ~]# cat pool.xml 
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/libvirt1/auto'/>
    <format type='nfs'/>
  </source>

[root@dhcp-66-70-62 ~]# virsh find-storage-pool-sources netfs pool.xml 
<sources>
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/iscsi21'/>
    <format type='nfs'/>
  </source>
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/iscsi22'/>
    <format type='nfs'/>
  </source>
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/libvirt2/manual'/>
    <format type='nfs'/>
  </source>
  <source>
    <host name='10.66.90.115'/>
    <dir path='/vol/mshao/vdctest'/>
    <format type='nfs'/>
  </source>
......

2.but logical type storage pool is unknown.
[root@dhcp-66-70-62 storagepoolschemadata]# cat pool-logical.xml 
<pool type='logical'>
  <name>HostVG</name>
  <uuid>1c13165a-d0f4-3aee-b447-30fb38789091</uuid>
  <capacity>99891544064</capacity>
  <allocation>99220455424</allocation>
  <available>671088640</available>
  <source>
    <name>HostVG</name>
    <format type='lvm2'/>
  </source>
  <target>
    <path>/dev/HostVG</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

[root@dhcp-66-70-62 storagepoolschemadata]# virt-xml-validate pool-logical.xml 
pool-logical.xml validates

[root@dhcp-66-70-62 storagepoolschemadata]# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
nfspool              active     no        

[root@dhcp-66-70-62 storagepoolschemadata]# virsh pool-create pool-logical.xml 
error: Failed to create pool from pool-logical.xml
error: internal error '/usr/sbin/vgchange -ay HostVG' exited with non-zero status 5 and signal 0:   Volume group "HostVG" not found

or:

[root@dhcp-66-70-62 storagepoolschemadata]# virsh pool-define pool-logical.xml
Pool HostVG defined from pool-logical.xml

[root@dhcp-66-70-62 storagepoolschemadata]# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
nfspool              active     no        
HostVG               inactive   no        

[root@dhcp-66-70-62 storagepoolschemadata]# virsh pool-start HostVG
error: Failed to start pool HostVG
error: internal error '/usr/sbin/vgchange -ay HostVG' exited with non-zero status 5 and signal 0:   Volume group "HostVG" not found


because logical type pool can't be started correctly,the error blocked me further testing it,I am not sure the final result. 


Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 ~]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5 #1 SMP Mon Dec 21 18:37:42 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 ~]# lsmod|grep kvm
kvm_intel              86664  1 
kvm                   223648  2 ksm,kvm_intel
[root@dhcp-66-70-62 ~]# rpm -qa|grep libvirt
libvirt-0.6.3-28.el5
libvirt-debuginfo-0.6.3-28.el5
libvirt-python-0.6.3-28.el5
[root@dhcp-66-70-62 ~]# rpm -qa|grep kvm
kvm-tools-83-140.el5
kvm-qemu-img-83-140.el5
etherboot-zroms-kvm-5.4.4-13.el5
kvm-83-140.el5
etherboot-roms-kvm-5.4.4-13.el5
kmod-kvm-83-140.el5
Comment 9 Cole Robinson 2010-01-06 09:15:06 EST
You shouldn't need to create a logical pool to actually test this bug.

virsh find-storage-pool-sources-as logical

should list all existing LVM volume groups on the system (even if libvirt has none set up). That's the point of the sources commands, it will enumerate existing shares that may exist outside of libvirt.

For 'find-storage-pool-sources', you can use:

echo "<source/>" > find.xml
virsh find-storage-pool-sources logical find.xml
Comment 10 Alex Jia 2010-01-07 02:31:53 EST
Hi,Cole,you are right,actually I don't need to create a logical pool.this bug has been fixed with libvirt-0.6.3-29.el5 on RHEL-5.5.

logical type pool is also successful:

[root@dhcp-66-70-173 storagepoolschemadata]# rpm -qa|grep libvirt
libvirt-debuginfo-0.6.3-29.el5
libvirt-python-0.6.3-29.el5
libvirt-0.6.3-29.el5
[root@dhcp-66-70-173 storagepoolschemadata]# rpm -qa|grep kvm
kvm-tools-83-140.el5
kvm-qemu-img-83-140.el5
kmod-kvm-83-140.el5
etherboot-zroms-kvm-5.4.4-13.el5
kvm-83-140.el5

[root@dhcp-66-70-173 storagepoolschemadata]# uname -a
Linux dhcp-66-70-173.nay.redhat.com 2.6.18-183.el5 #1 SMP Mon Dec 21 18:37:42 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

[root@dhcp-66-70-173 storagepoolschemadata]# virsh find-storage-pool-sources-as logical logical.xml 
<sources>
  <source>
    <device path='/dev/sda10'/>
    <name>HostVG</name>
    <format type='lvm2'/>
  </source>
</sources>
Comment 15 errata-xmlrpc 2010-03-30 04:10:34 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0205.html

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