Bug 1072653
Summary: | vol-upload should change the volume target format type after uploading a different format file to it | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu |
Component: | libvirt | Assignee: | John Ferlan <jferlan> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | ajia, dyuan, eblake, mzhan, pzhang, rbalakri, shyu, xuzhang, yanyang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.8-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-05 07:31:00 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1176182 |
Description
chhu
2014-03-05 01:56:00 UTC
The target image format and capacity are changed as expected after refreshing pool. However, no any messages are output after vol-upload returns. I hit the similar issue when i run vol-download. # virsh vol-download qcow3-vol /var/lib/libvirt/images/raw default No any messages are printed after runing vol-download. Not sure volume upload between different formats was Also of note (assuming you are in the directory for the 'default' pool): $ qemu-img create -f qcow2 test-qcow2-4g.img 4G $ qemu-img info /home/vm-images/test-qcow2-4g.img image: /home/vm-images/test-qcow2-4g.img file format: qcow2 virtual size: 4.0G (4294967296 bytes) disk size: 196K cluster_size: 65536 $ qemu-img create -f qcow2 test-qcow2-2g.img 2G $ qemu-img info test-qcow2-2g.img image: test-qcow2-2g.img file format: qcow2 virtual size: 2.0G (2147483648 bytes) disk size: 196K cluster_size: 65536 $ virsh vol-refresh default $ virsh vol-upload test-qcow2-4g.img test-qcow2-2g.img default $ qemu-img info test-qcow2-4g.img image: test-qcow2-4g.img file format: qcow2 virtual size: 2.0G (2147483648 bytes) disk size: 196K cluster_size: 65536 $ virsh vol-info test-qcow2-4g.img default Name: test-qcow2-4g.img Type: file Capacity: 4.00 GiB Allocation: 196.00 KiB $ Not so sure uploading anything into a qcow2 file will do what is expected - although there is the guestfish tool which may be able to handle the job. Of course that's the issue here - should we disallow - that's something I'll continue to investigate... It might be possible to use the convert/resize options as well in order to do what's desired; however, whether it's "worth the effort" or there's "enough" space in the pool for the conversion is an issue that has to be considered. Posted a possible solution upstream: http://www.redhat.com/archives/libvir-list/2014-July/msg01395.html Pushed upstream: commit 4a85bf3e2fa703fdc14e8c49d5017ef04832a1d7 Author: John Ferlan <jferlan> Date: Mon Jul 28 08:39:09 2014 -0400 storage: Refresh storage pool after upload https://bugzilla.redhat.com/show_bug.cgi?id=1072653 Upon successful upload of a volume, the target volume and storage pool were not updated to reflect any changes as a result of the upload. Make use of the existing stream close callback mechanism to force a backend pool refresh to occur in a separate thread once the stream closes. The separate thread should avoid potential deadlocks if the refresh needed to wait on some event from the event loop which is used to perform the stream callback. $ git describe v1.2.7-5-g4a85bf3 The patch for this bug caused CVE-2014-8135. Verify Version : libvirt-1.2.8-11.el7.x86_64 qemu-kvm-rhev-2.1.2-17.el7.x86_64 kernel-3.10.0-220.el7.x86_64 Verify steps : 1.create two different types volumes in default pool # qemu-img create -f qcow2 qcow2.img 4G Formatting 'qcow2.img', fmt=qcow2 size=4294967296 encryption=off cluster_size=65536 lazy_refcounts=off # qemu-img create -f raw raw.img 2G Formatting 'raw.img', fmt=raw size=2147483648 # qemu-img info qcow2.img image: qcow2.img file format: qcow2 virtual size: 4.0G (4294967296 bytes) disk size: 196K cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false # qemu-img info raw.img image: raw.img file format: raw virtual size: 2.0G (2147483648 bytes) disk size: 0 1.1 check vol info # virsh vol-list default --details Name Path Type Capacity Allocation ------------------------------------------------------------------------------ qcow2.img /var/lib/libvirt/images/qcow2.img file 4.00 GiB 196.00 KiB raw.img /var/lib/libvirt/images/raw.img file 2.00 GiB 0.00 B # virsh vol-dumpxml qcow2.img --pool default <volume type='file'> ...... <capacity unit='bytes'>4294967296</capacity> <allocation unit='bytes'>200704</allocation> <target> <path>/var/lib/libvirt/images/qcow2.img</path> <format type='qcow2'/> <===qcow2 ...... </volume> # virsh vol-dumpxml raw.img --pool default <volume type='file'> ...... <capacity unit='bytes'>2147483648</capacity> <allocation unit='bytes'>0</allocation> <target> <path>/var/lib/libvirt/images/raw.img</path> <format type='raw'/> <===raw ...... </volume> 2.try to upload volume of qcow2 format to raw # virsh vol-upload --vol raw.img qcow2.img --pool default 3.after upload successfully , check raw.img volume info # qemu-img info raw.img image: raw.img file format: qcow2 <=== qcow2 type virtual size: 4.0G (4294967296 bytes) disk size: 196K cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false 4.check volume info # virsh vol-list default --details Name Path Type Capacity Allocation ------------------------------------------------------------------------------ qcow2.img /var/lib/libvirt/images/qcow2.img file 4.00 GiB 196.00 KiB raw.img /var/lib/libvirt/images/raw.img file 4.00 GiB 196.00 KiB # virsh vol-dumpxml raw.img --pool default <volume type='file'> ...... <capacity unit='bytes'>4294967296</capacity> <allocation unit='bytes'>200704</allocation> <target> <path>/var/lib/libvirt/images/raw.img</path> <format type='qcow2'/> <===it is qcow2 ...... </volume> 5. try to operate uploaded volume .do vol-clone successfully # virsh vol-clone raw.img raw.img.clone default Vol raw.img.clone cloned from raw.img # virsh vol-info raw.img.clone default Name: raw.img.clone Type: file Capacity: 4.00 GiB Allocation: 196.00 KiB try to upload raw to qcow2 1.prepare two volumes # virsh vol-list default --details Name Path Type Capacity Allocation ------------------------------------------------------------------------------ qcow2.img /var/lib/libvirt/images/qcow2.img file 1.00 GiB 196.00 KiB raw.img /var/lib/libvirt/images/raw.img file 1.00 GiB 0.00 B 2.upload volume of raw format to qcow2. upload successfully. # virsh vol-upload --vol qcow2.img raw.img default 3.check volume info # qemu-img info qcow2.img image: qcow2.img file format: raw virtual size: 1.0G (1073741824 bytes) disk size: 1.0G # virsh vol-list default --details Name Path Type Capacity Allocation ------------------------------------------------------------------------------ qcow2.img /var/lib/libvirt/images/qcow2.img file 1.00 GiB 1.00 GiB raw.img /var/lib/libvirt/images/raw.img file 1.00 GiB 0.00 B # qemu-img info qcow2.img image: qcow2.img file format: raw <===format is raw virtual size: 1.0G (1073741824 bytes) disk size: 1.0G 4.operate uploaded volume. do vol-clone successfully. # virsh vol-clone qcow2.img qcow2.img.clone --pool default Vol qcow2.img.clone cloned from qcow2.img # virsh vol-dumpxml qcow2.img.clone default <volume type='file'> <name>qcow2.img.clone</name> <key>/var/lib/libvirt/images/qcow2.img.clone</key> <source> </source> <capacity unit='bytes'>1073741824</capacity> <allocation unit='bytes'>1073741824</allocation> <target> <path>/var/lib/libvirt/images/qcow2.img.clone</path> <format type='raw'/> ...... </volume> additional info: Try to upload a domain image file . Guest can start and can do some operations in guest after upload successfully. Try to refresh pool during vol-upload , upload successfully . Volume target format type was changed after uploading a different format file . and the volume works well . Move to verified. 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/RHSA-2015-0323.html |