Description: find-storage-pool-sources/find-storage-pool-sources-as got wrong source format type Version-Release number of selected component (if applicable): libvirt-1.1.1-25.el7.x86_64 qemu-kvm-rhev-1.5.3-50.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. define and start a netfs pool with source format type='glusterfs' # virsh pool-dumpxml netfs-gluster <pool type='netfs'> <name>netfs-gluster</name> <uuid>d5609ced-94b1-489e-b218-eff35c30336a</uuid> <capacity unit='bytes'>856564301824</capacity> <allocation unit='bytes'>35528245248</allocation> <available unit='bytes'>821036056576</available> <source> <host name='10.66.84.12'/> <dir path='/gluster-vol1'/> <format type='glusterfs'/> </source> <target> <path>/mnt/gluster</path> <permissions> <mode>0755</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> # virsh pool-list --type netfs Name State Autostart ----------------------------------------- netfs-gluster active no 2. check the gluster mount type on the host is fuse.glusterfs # mount |grep gluster 10.66.84.12:/gluster-vol1 on /mnt/gluster type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072) 3. run find-storage-pool-sources to find the source: the source format type='nfs' # more sources.xml <source> <host name='10.66.84.12'/> </source> # virsh find-storage-pool-sources netfs sources.xml <sources> <source> <host name='10.66.84.12'/> <dir path='/gluster-vol1'/> <format type='nfs'/> </source> </sources> # virsh find-storage-pool-sources-as netfs 10.66.84.12 <sources> <source> <host name='10.66.84.12'/> <dir path='/gluster-vol1'/> <format type='nfs'/> </source> </sources> Expected results: In step3: find-storage-pool-sources/find-storage-pool-sources-as got the source format type='glusterfs' Actual results: In step3: find-storage-pool-sources/find-storage-pool-sources-as got the source format type='nfs'
Is your gluster server configured to export the volumes using NFS in addition to the native protocol? http://gluster.org/community/documentation/index.php/Gluster_3.2:_Using_NFS_with_Gluster If it's so, then the output is correct. The bug should then be changed to support lookup of gluster sources along with nfs.
(In reply to Peter Krempa from comment #1) > Is your gluster server configured to export the volumes using NFS in > addition to the native protocol? > > http://gluster.org/community/documentation/index.php/Gluster_3.2: > _Using_NFS_with_Gluster > > If it's so, then the output is correct. The bug should then be changed to > support lookup of gluster sources along with nfs. The gluster server configured to export the volumes using NFS in addition to the native protocol. # gluster volume info gluster-vol1 | grep nfs.disable nfs.disable: off After I set the nfs.disable=on in the gluster server, the test results are: # gluster volume info gluster-vol1 | grep nfs.disable nfs.disable: on # virsh pool-list --type netfs Name State Autostart ----------------------------------------- netfs-gluster active no # mount| grep gluster 10.66.84.12:/gluster-vol1 on /mnt/gluster type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072) # virsh find-storage-pool-sources netfs sources.xml error: Failed to find any netfs pool sources error: internal error: Child process (/usr/sbin/showmount --no-headers --exports 10.66.84.12) unexpected exit status 1 # virsh find-storage-pool-sources-as netfs 10.66.84.12 error: Failed to find any netfs pool sources error: internal error: Child process (/usr/sbin/showmount --no-headers --exports 10.66.84.12) unexpected exit status 1
The issue here is that our code isn't able to find glusterfs pools via the native protocol. The output provided in comment 1 is correct as the volumes in question are indeed exported via glusterd's NFS export. Libvirt should be able to look up native glusterfs exports too. Additionally if the lookup command fails the reported error should be improved.
Added upstream: commit cb93802958e0f2f7f2d8c494826d9c583094da8d Author: Peter Krempa <pkrempa> Date: Thu Mar 27 13:39:51 2014 +0100 storage: gluster: Implement storage pool lookup Use the previously implemented function to lookup glusterfs source pools for the netfs pool to lookup native gluster pools too. commit 05671b95dbe3a141a8ec93262df9d28e0509ae24 Author: Peter Krempa <pkrempa> Date: Wed Mar 26 19:17:55 2014 +0100 storage: netfs: Support lookup of glusterfs pool sources https://bugzilla.redhat.com/show_bug.cgi?id=1072714 Use the "gluster" command line tool to retrieve information about remote volumes on a gluster server to allow storage pool source lookup. Unfortunately gluster doesn't provide a management library so that we could use that directly, instead the RPC calls are hardcoded in the command line tool. commit 18642d100f2f73c3a9a42211cddf5cda38943656 Author: Peter Krempa <pkrempa> Date: Wed Mar 26 17:25:40 2014 +0100 storage: netfs: Split up and tidy up NFS storage pool source function Extract the NFS related stuff into a separate function and tidy up the rest of the code so we can reuse it to add gluster backend detection. Additionally avoid reporting of errors from "showmount" and return an empty source list instead. This will help when adding other detection backends.
Libvirt's 1.2.4 release contains this functionality.