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 1282283 - Storage volume is not removed when creating fails in root squash pool
Summary: Storage volume is not removed when creating fails in root squash pool
Keywords:
Status: CLOSED DUPLICATE of bug 1233003
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-16 02:42 UTC by Yang Yang
Modified: 2015-11-16 12:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-16 12:10:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yang Yang 2015-11-16 02:42:59 UTC
Description of problem:
Storage volume is not removed when creating fails in root squash pool

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

How reproducible:
100%

Steps to Reproduce:
1.Setup a nfs server with root_squash
# cat /etc/exports
/var/lib/libvirt/images/nfs *(rw,sync,root_squash)

Change the nfs dir owner to qemu, and chmod to 755.
# chown qemu.qemu /var/lib/libvirt/images/nfs \
&& chmod 755 /var/lib/libvirt/images/nfs


2. Create nfs pool with qemu user and group.
# cat nfs.xml
<pool type='netfs'>
<name>nfs</name>
<source>
<host name='10.66.x.x'/>
<dir path='/var/lib/libvirt/images/nfs'/>
<format type='nfs'/>
</source>
<target>
<path>/mnt/nfs</path>
<permissions>
<mode>0755</mode>
<owner>107</owner>
<group>107</group>
</permissions>
</target>

# virsh pool-define nfs.xml&& virsh pool-build nfs && virsh pool-start nfs
Pool nfs defined from nfs.xml

Pool nfs built

Pool nfs started

3. create a volume with following xml
# cat nfs.vol.xml
<volume type='file'>
  <name>test.qcow2</name>
  <capacity unit='bytes'>1048576000</capacity>
  <target>
    <format type='qcow2'/>
<permissions>
<owner>0</owner>
<group>0</group>
</permissions>
  </target>
</volume>

# virsh vol-create nfs nfs.vol.xml
error: Failed to create vol from nfs.vol.xml
error: cannot unlink file '/mnt/nfs/test.qcow2': Success

4. underlying file is not created, but storage volume is not removed,

# virsh vol-list netfs | grep test.qcow2
 test.qcow2           /mnt/nfs/test.qcow2

# ll /mnt/nfs/test.qcow2
ls: cannot access /mnt/nfs/test.qcow2: No such file or directory

Actual results:
Storage volume is not removed when vol creation fails with root user in root squash nfs pool

Expected results:
Storage volume should be removed when vol creation fails

Additional info:
2015-11-13 06:35:44.815+0000: 3477: error : virCommandWait:2552 : internal error: Child process (/usr/bin/qemu-img create -f qcow2 -o compat=0.10 /mnt/nfs/test.qcow2 1024000K) unexpected exit status 1: 2015-11-13 06:35:44.761+0000: 25360: debug : virFileClose:102 : Closed fd 24
2015-11-13 06:35:44.761+0000: 25360: debug : virFileClose:102 : Closed fd 26
2015-11-13 06:35:44.761+0000: 25360: debug : virFileClose:102 : Closed fd 22
libust[25360/25360]: Warning: HOME environment variable not set. Disabling LTTng-UST per-user tracing. (in setup_local_apps() at lttng-ust-comm.c:305)
qemu-img: /mnt/nfs/test.qcow2: Could not create file: Permission denied
2015-11-13 06:35:44.815+0000: 3477: debug : virCommandRun:2279 : Result status 0, stdout: 'Formatting '/mnt/nfs/test.qcow2', fmt=qcow2 size=1048576000 compat='0.10' encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
2015-11-13 06:35:44.817+0000: 3477: error : virFileUnlink:2364 : internal error: child failed to unlink '/mnt/nfs/test.qcow2': exit status 2
2015-11-13 06:35:44.817+0000: 3477: error : virStorageBackendFileSystemVolDelete:1212 : cannot unlink file '/mnt/nfs/test.qcow2': Success

Comment 1 John Ferlan 2015-11-16 12:10:08 UTC
Duplicating to bz 1233003 since it handles the more generic issue regarding deletion of volumes during the creation/build processing.

I believe in particular the root squash nfs issue for a 'raw' volume is handled by commit id '2265e7dd' while for a qcow2 volume commit id '77346f27'.

*** This bug has been marked as a duplicate of bug 1233003 ***


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