Bug 1092882

Summary: vol-list get volume which actually does not exist
Product: Red Hat Enterprise Linux 6 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: dyuan, lagarcia, mzhan, rbalakri
Target Milestone: rc   
Target Release: 6.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.2-36.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 04:21:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shanzhi Yu 2014-04-30 07:46:30 UTC
Description of problem:

vol-list get volume which actually does not exist

Version-Release number of selected component (if applicable):

libvirt-0.10.2-34.el6.x86_64

How reproducible:

100%

Steps to Reproduce:

1.Prepare an NFS server with below configuration
[nfs server]#cat /etc/export

/mnt/nfs*(sync,rw,no_all_squash)

2.define an netfs type pool

# virsh pool-dumpxml netfs-nfs
<pool type='netfs'>
  <name>netfs-nfs</name>
  <uuid>7caa395b-5b1d-a2c1-9ef4-3035f100990f</uuid>
  <capacity unit='bytes'>84551925760</capacity>
  <allocation unit='bytes'>3193962496</allocation>
  <available unit='bytes'>81357963264</available>
  <source>
    <host name='nfs server'/>
    <dir path='/mnt/nfs'/>
    <format type='auto'/>
  </source>
  <target>
    <path>/var/lib/libvirt/images/netfs-nfs</path>
    <permissions>
      <mode>0755</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

3. create raw format image
# virsh vol-create-as netfs-nfs raw.img --format raw 100M
error: Failed to create vol raw.img
error: cannot create path '/var/lib/libvirt/images/netfs-nfs/raw.img': Operation not permitted

# virsh vol-create-as netfs-nfs raw.img --format raw 100M
error: Failed to create vol raw.img
error: Storage volume not found: storage vol already exists


4. check raw.img

# virsh vol-list netfs-nfs|grep raw.img
raw.img              /var/lib/libvirt/images/netfs-nfs/raw.img

# qemu-img info /var/lib/libvirt/images/netfs-nfs/raw.img
Could not open '/var/lib/libvirt/images/netfs-nfs/raw.img': No such file or directory


Actual results:


Expected results:

Fail to create raw type image with netfs pool while vol-list get that image. 

Additional info:

after refresh pool, the problem gone.

Comment 5 chhu 2014-05-27 03:33:27 UTC
Reproduced with libvirt-0.10.2-33.el6.x86_64,

Verified with package:
libvirt-0.10.2-37.el6.x86_64

Test steps:
1. Prepare an NFS server with below configuration:
[nfs server]# cat /etc/export
/mnt/nfs*(sync,rw,no_all_squash)

2. Define,build,start an netfs type pool
# virsh pool-dumpxml netfs-nfs
<pool type='netfs'>
  <name>netfs-nfs</name>
  <uuid>7caa395b-5b1d-a2c1-9ef4-3035f100990f</uuid>
  <capacity unit='bytes'>53634662400</capacity>
  <allocation unit='bytes'>37549506560</allocation>
  <available unit='bytes'>16085155840</available>
  <source>
    <host name='nfs server'/>
    <dir path='/mnt/nfs'/>
    <format type='auto'/>
  </source>
  <target>
    <path>/var/lib/libvirt/images/netfs-nfs</path>
    <permissions>
      <mode>0755</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

3. create raw format image failed with permission denied.
# virsh vol-create-as netfs-nfs raw.img --format raw 100M
error: Failed to create vol raw.img
error: Failed to create file '/var/lib/libvirt/images/netfs-nfs/raw.img': Permission denied

# virsh vol-create-as netfs-nfs raw.img --format raw 100M
error: Failed to create vol raw.img
error: Failed to create file '/var/lib/libvirt/images/netfs-nfs/raw.img': Permission denied

4. check raw.img is not existed.
# virsh vol-list netfs-nfs
Name                 Path                                    
-----------------------------------------

Test results:
Current command work well.

Comment 7 errata-xmlrpc 2014-10-14 04:21:43 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/RHBA-2014-1374.html