Bug 1542858
Summary: | size of luks-encrypted qcow2 image exceeds the required in qemu-img measure output. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Longxiang Lyu <lolyu> |
Component: | qemu-kvm | Assignee: | Eric Blake <eblake> |
Status: | CLOSED DUPLICATE | QA Contact: | Tingting Mao <timao> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | --- | CC: | berrange, coli, juzhang, knoel, michen, qzhang, rbalakri, virt-maint |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-12-17 08:18:06 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
Longxiang Lyu
2018-02-07 08:03:23 UTC
The LUKS header has a couple of MB approx size overhead. The size is independent of the overall file size, but can vary depending on crypto parameters via a complex formula luks->header.payload_offset = (QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET / QCRYPTO_BLOCK_LUKS_SECTOR_SIZE) + (ROUND_UP(DIV_ROUND_UP(splitkeylen, QCRYPTO_BLOCK_LUKS_SECTOR_SIZE), (QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET / QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) * QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS); and in qcow2 that then needs to be rounded up to nearest cluster size. IOW, to get this info reported accurately, we would need to expose some API in the internal crypto code, upto the block layer. The user would also need to set their desired crypto options (cipher, keysize, etc). |