Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1688086 - Preallocation mode "full" does not work for 'qemu-img create' over libgfapi
Summary: Preallocation mode "full" does not work for 'qemu-img create' over libgfapi
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.0
Assignee: Stefano Garzarella
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-13 05:33 UTC by Tingting Mao
Modified: 2019-04-06 23:22 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Tingting Mao 2019-03-13 05:33:36 UTC
Description of problem:
Create RAW/QCOW2 images with preallocation=full option with no error. But after mapping the images, they were not fully allocated.


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

Client:
qemu-kvm-2.12.0-63.module+el8+2833+c7d6d092
kernel-4.18.0-77.el8
glusterfs-cli-3.12.2-40.2.el8

Server:
glusterfs-server-3.12.2-43.el7rhgs


How reproducible:
100%


Steps to Reproduce:

QCOW2
1. Create image with preallocation=full

# time qemu-img create -f qcow2 gluster://10.73.196.181/vol0/test_full.qcow2 5G -o preallocation=full
Formatting 'gluster://10.73.196.181/vol0/test_full.qcow2', fmt=qcow2 size=5368709120 cluster_size=65536 preallocation=full lazy_refcounts=off refcount_bits=16
[2019-03-13 03:16:45.544362] E [MSGID: 108006] [afr-common.c:5114:__afr_handle_child_down_event] 0-vol0-replicate-0: All subvolumes are down. Going offline until atleast one of them comes back up.
[2019-03-13 03:16:48.192484] E [MSGID: 108006] [afr-common.c:5114:__afr_handle_child_down_event] 0-vol0-replicate-0: All subvolumes are down. Going offline until atleast one of them comes back up.

real	0m4.028s --- Too fast compared to creating same image locally(1m17.691s)
user	0m0.139s
sys	0m0.055s

2. Map the image. 
# qemu-img map gluster://10.73.196.181/vol0/test_full.qcow2 --output=json
[{ "start": 0, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 327680},
{ "start": 536870912, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 537264128},
{ "start": 1073741824, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 1074200576},
{ "start": 1610612736, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 1611137024},
{ "start": 2147483648, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 2148139008},
{ "start": 2684354560, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 2685075456},
{ "start": 3221225472, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 3222011904},
{ "start": 3758096384, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 3758948352},
{ "start": 4294967296, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 4295950336},
{ "start": 4831838208, "length": 536866816, "depth": 0, "zero": true, "data": true, "offset": 4832886784},
{ "start": 5368705024, "length": 4096, "depth": 0, "zero": false, "data": true, "offset": 5369753600}]



RAW

1. Create image with preallocation=full

# time qemu-img create -f raw gluster://10.73.196.181/vol0/test_full.img 5G -o preallocation=full
Formatting 'gluster://10.73.196.181/vol0/test_full.img', fmt=raw size=5368709120 preallocation=full
[2019-03-13 05:06:10.749767] E [MSGID: 108006] [afr-common.c:5114:__afr_handle_child_down_event] 0-vol0-replicate-0: All subvolumes are down. Going offline until atleast one of them comes back up.

real	0m1.028s --- Too fast compared to creating same image locally(1m26.187s)
user	0m0.046s
sys	0m0.021s

2. Map the image
# qemu-img map --output=json gluster://10.73.196.181/vol0/test_full.img
[{ "start": 0, "length": 5368709120, "depth": 0, "zero": true, "data": false, "offset": 0}]
[2019-03-13 05:06:41.869288] E [MSGID: 108006] [afr-common.c:5114:__afr_handle_child_down_event] 0-vol0-replicate-0: All subvolumes are down. Going offline until atleast one of them comes back up.


Actual results:
As above.


Expected results:
For "full" preallocation mode, the image should be allocated fully. And the value of "zero" field the map info should be "false"


Additional info:
For qcow2, "falloc" and "metadata" modes both work okay. And for RAW, "falloc" works okay, too.


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