Bug 1241454
| Summary: | Underlying file was not removed when volume create/build fails | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Yang Yang <yanyang> |
| Component: | libvirt | Assignee: | Erik Skultety <eskultet> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.2 | CC: | dyuan, eskultet, mzhan, rbalakri, xuzhang, yisun |
| Target Milestone: | rc | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.17-2.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 06:48:35 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
Yang Yang
2015-07-09 09:20:25 UTC
Fixed upstream:
commit b5637871920c88d88a32343a13c6c1476062a6bb
Author: Erik Skultety <eskultet>
Date: Thu Jul 9 11:17:12 2015 +0200
storage: Revert volume obj list updating after volume creation (4749d82a)
This patch reverts commit 4749d82a which tried to tweak the logic in
volume creation. We did realloc and update our object list before we executed
volume building within a specific storage backend. If that failed, we
had to update (again) our object list to the original state as it was before the
build and delete the volume from the pool (even though it didn't exist - this
truly depends on the backend).
I misunderstood the base idea to be able to poll the status of the volume
creation using vol-info. After commit 4749d82a this wasn't possible
anymore, although no BZ has been reported yet.
Commit 4749d82a also claimed to fix
https://bugzilla.redhat.com/show_bug.cgi?id=1223177, but commit c8be606b of the
same series as 4749d82ad (which was more of a refactor than a fix)
fixes the same issue so the revert should be pretty straightforward.
Further more, BZ https://bugzilla.redhat.com/show_bug.cgi?id=1241454 can be
fixed with this revert.
v1.2.17-58-gb563787
Verified on:
libvirt-1.2.17-2.el7.x86_64
qemu-kvm-rhev-2.3.0-9.el7.x86_64
kernel-3.10.0-290.el7.x86_64
1. Prepared a pool
# virsh pool-dumpxml default
<pool type='dir'>
<name>default</name>
<uuid>3fb748f5-8b63-4aad-bd76-908b5434e4af</uuid>
<capacity unit='bytes'>214643507200</capacity>
<allocation unit='bytes'>30016999424</allocation>
<available unit='bytes'>184626507776</available>
<source>
</source>
<target>
<path>/home/pool</path>
<permissions>
<mode>0755</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:home_root_t:s0</label>
</permissions>
</target>
</pool>
2. create a volume with size exceeding disk left space
# virsh vol-create-as default big.img 10000G
error: Failed to create vol big.img
error: cannot allocate 10737418240000 bytes in file '/home/pool/big.img': No space left on device
3. check the pool's directory
# ll /home/pool/ -a
total 4
drwxr-xr-x. 2 root root 6 Jul 14 13:31 .
drwxr-xr-x. 6 root root 4096 Jul 13 18:14 ..
<==== vol file not created as expect.
[root@localhost ~]# virsh vol-list default
Name Path
------------------------------------------------------------------------------
<===== no vol listed as expect.
4. create a volume with reasonable size
# virsh vol-create-as default big.img 1G
Vol big.img created
5. check the vol-info works well against the volume
# virsh vol-info big.img --pool default
Name: big.img
Type: file
Capacity: 1.00 GiB
Allocation: 1.00 GiB
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. https://rhn.redhat.com/errata/RHBA-2015-2202.html |