Bug 1651872 - [fast train] preallocation mode doesn't work for luks format
Summary: [fast train] preallocation mode doesn't work for luks format
Keywords:
Status: CLOSED DUPLICATE of bug 1534951
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Daniel Berrangé
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-21 05:47 UTC by Yihuang Yu
Modified: 2019-08-26 19:39 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-16 07:47:47 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yihuang Yu 2018-11-21 05:47:04 UTC
Description of problem:
QEMU support preallocation mode for luks format now, actually I can use it when creating the a luks image, but the image is not preallocated.
RHEL7 has the same bugs: https://bugzilla.redhat.com/show_bug.cgi?id=1534951#c4 https://bugzilla.redhat.com/show_bug.cgi?id=1594864

Version-Release number of selected component (if applicable):
QEMU version (fast train)
# /usr/libexec/qemu-kvm --version
QEMU emulator version 3.0.0 (qemu-kvm-3.0.0-2.module+el8+2208+e41b12e0)

How reproducible:
100%

Steps to Reproduce:
1. Check the support options
# qemu-img create -f luks --object secret,id=sec0,data=test -o key-secret=sec0 test.luks 1G -o ?
Supported options:
size             Virtual disk size
key-secret       ID of the secret that provides the keyslot passphrase
cipher-alg       Name of encryption cipher algorithm
cipher-mode      Name of encryption cipher mode
ivgen-alg        Name of IV generator algorithm
ivgen-hash-alg   Name of IV generator hash algorithm
hash-alg         Name of encryption hash algorithm
iter-time        Time to spend in PBKDF in milliseconds
nocow            Turn off copy-on-write (valid only on btrfs)
preallocation    Preallocation mode (allowed values: off, falloc, full)

2. Create a luks image with full mode
# qemu-img create -f luks --object secret,id=sec0,data=testfull -o key-secret=sec0 testfull.luks 1G -o preallocation=full
Formatting 'testfull.luks', fmt=luks size=1073741824 key-secret=sec0 preallocation=full
# qemu-img info --object secret,data=testfull,id=sec0 --image-opts driver=file,filename=testfull.luks
image: testfull.luks
file format: file
virtual size: 1.0G (1075810304 bytes)
disk size: 256K
# du -ah
256K	./testfull.luks
256K	.

3.Create a luks image with falloc mode
# qemu-img create -f luks --object secret,id=sec0,data=testfalloc -o key-secret=sec0 testfalloc.luks 1G -o preallocation=falloc
Formatting 'testfalloc.luks', fmt=luks size=1073741824 key-secret=sec0 preallocation=falloc
# qemu-img info --object secret,data=testfalloc,id=sec0 --image-opts driver=file,filename=testfalloc.luks
image: testfalloc.luks
file format: file
virtual size: 1.0G (1075810304 bytes)
disk size: 256K
# du -ah
256K	./testfull.luks
256K	./testfalloc.luks
512K	.

4. Create a luks image with off mode
# qemu-img create -f luks --object secret,id=sec0,data=testoff -o key-secret=sec0 testoff.luks 1G -o preallocation=off
Formatting 'testoff.luks', fmt=luks size=1073741824 key-secret=sec0 preallocation=off
# qemu-img info --object secret,data=testoff,id=sec0 --image-opts driver=file,filename=testoff.luks
image: testoff.luks
file format: file
virtual size: 1.0G (1075810304 bytes)
disk size: 256K
# du -ah
256K	./testfull.luks
256K	./testfalloc.luks
256K	./testoff.luks
768K	.

Additional info:

Comment 2 Tingting Mao 2019-07-16 07:47:47 UTC

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


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