Bug 1514373 - RFE: support preallocation=falloc/full/off when create raw image on cephfs
Summary: RFE: support preallocation=falloc/full/off when create raw image on cephfs
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: ---
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: zixchen
URL:
Whiteboard:
: 1200232 1782666 (view as bug list)
Depends On:
Blocks: 1200234
TreeView+ depends on / blocked
 
Reported: 2017-11-17 09:09 UTC by Longxiang Lyu
Modified: 2021-02-18 02:19 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-15 07:31:15 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Longxiang Lyu 2017-11-17 09:09:32 UTC
Description of problem:
not support preallocation=falloc/full/off when create raw image on cephfs

Version-Release number of selected component (if applicable):
kernel-3.10.0-785.el7.x86_64
qemu-kvm-rhev-2.10.0-6.el7
ceph-12.2.1-37.el7cp.x86_64

How reproducible:
100%

Steps to Reproduce:
1. create raw image on cephfs
# qemu-img create -f raw  rbd:kvm-test/test.img:mon_host=10.73.199.64 1G 
Formatting 'rbd:kvm-test/test.img:mon_host=10.73.199.64', fmt=raw size=1073741824


2. create raw image on cephfs with preallocation=off/full/falloc

# qemu-img create -f raw -o preallocation=off rbd:kvm-test/test1.img:mon_host=10.73.199.64 1G 
qemu-img: Invalid parameter 'preallocation'
qemu-img: rbd:kvm-test/test1.img:mon_host=10.73.199.64: Invalid options for file format 'raw'

# qemu-img create -f raw -o preallocation=full rbd:kvm-test/test1.img:mon_host=10.73.199.64 1G 
qemu-img: Invalid parameter 'preallocation'
qemu-img: rbd:kvm-test/test1.img:mon_host=10.73.199.64: Invalid options for file format 'raw'

# qemu-img create -f raw -o preallocation=falloc rbd:kvm-test/test1.img:mon_host=10.73.199.64 1G 
qemu-img: Invalid parameter 'preallocation'
qemu-img: rbd:kvm-test/test1.img:mon_host=10.73.199.64: Invalid options for file format 'raw'


Actual results:
As the results above.

Expected results:
Should successfully create raw image with preallocation on cephfs. If preallocation mode is not supported, should give error message like "preallocation not supported" instead of "qemu-img: Invalid parameter 'preallocation'"

Additional info:

Comment 5 yilzhang 2017-12-13 06:19:21 UTC
Creating raw image with preallocation=falloc/full/off  on iSCSI backend also has this problem:

# qemu-img create -f raw  iscsi://10.0.0.7/iqn.2017-08.com.yilzhang:libiscsi/0    10G   -o preallocation=full
qemu-img: Invalid parameter 'preallocation'
qemu-img: iscsi://10.0.0.7/iqn.2017-08.com.yilzhang:libiscsi/0: Invalid options for file format 'raw'

Comment 6 Jeff Cody 2018-06-13 18:57:51 UTC
*** Bug 1200232 has been marked as a duplicate of this bug. ***

Comment 8 Stefano Garzarella 2019-04-27 11:48:18 UTC
I posted a patch upstream to add the support of preallocation (full/off) for RBD images.
https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg04663.html

Comment 9 Tingting Mao 2019-08-26 05:40:31 UTC
For qcow2 with rbd, preallocation=full does not work now.


Tested with:
qemu-kvm-4.1.0-4.module+el8.1.0+4020+16089f93
kernel-4.18.0-135.el8


Preallocation=off
# qemu-img create -f qcow2 -o preallocation=off rbd:kvmtest-pool/test.qcow2 2G
Formatting 'rbd:kvmtest-pool/test.qcow2', fmt=qcow2 size=2147483648 cluster_size=65536 preallocation=off lazy_refcounts=off refcount_bits=16

# qemu-img map --output=json rbd:kvmtest-pool/test_off.img
[{ "start": 0, "length": 2147483648, "depth": 0, "zero": true, "data": false}]


Preallocation=metadata
# qemu-img create -f qcow2 -o preallocation=metadata  rbd:kvmtest-pool/test.qcow2 5G
Formatting 'rbd:kvmtest-pool/test.qcow2', fmt=qcow2 size=5368709120 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16

# qemu-img map --output=json rbd:kvmtest-pool/test.qcow2
[{ "start": 0, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 327680},
{ "start": 536870912, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 537264128},
{ "start": 1073741824, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 1074200576},
{ "start": 1610612736, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 1611137024},
{ "start": 2147483648, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 2148139008},
{ "start": 2684354560, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 2685075456},
{ "start": 3221225472, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 3222011904},
{ "start": 3758096384, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 3758948352},
{ "start": 4294967296, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 4295950336},
{ "start": 4831838208, "length": 536870912, "depth": 0, "zero": false, "data": true, "offset": 4832886784}]


Preallocation=full
# qemu-img create -f qcow2 -o preallocation=full rbd:kvmtest-pool/test_full.qcow2 5G
Formatting 'rbd:kvmtest-pool/test_full.qcow2', fmt=qcow2 size=5368709120 cluster_size=65536 preallocation=full lazy_refcounts=off refcount_bits=16
qemu-img: rbd:kvmtest-pool/test_full.qcow2: Could not resize image: Failed to resize underlying file: Unsupported preallocation mode 'full'

Comment 10 Stefano Garzarella 2019-08-26 08:53:33 UTC
(In reply to Tingting Mao from comment #9)
> For qcow2 with rbd, preallocation=full does not work now.
> 

The patch is not merged yet, I sent a v3 [1] and now I'm working on the v4. I hope I'll send it this week.

[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg632765.html

Comment 11 Stefano Garzarella 2019-12-17 09:42:12 UTC
*** Bug 1782666 has been marked as a duplicate of this bug. ***

Comment 12 Ademar Reis 2020-02-05 22:45:09 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 16 RHEL Program Management 2021-02-15 07:31:15 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 17 zixchen 2021-02-18 02:19:20 UTC
For rbd backend, only create qcow2 image with preallocation=off has no error. As it is a RFE bug, QA agrees to close this bug.

Checked version 
qemu-kvm-5.2.0-1.module+el8.4.0+9091+650b220a.x86_64

#qemu-img create -f qcow2 -o preallocation=off rbd:rbd/test.qcow2 1G
Formatting 'rbd:rbd/test.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=off compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16


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