Bug 1613746
Summary: | vol-resize with --shrink can't shrink encrypted volume | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Meina Li <meili> | |
Component: | libvirt | Assignee: | John Ferlan <jferlan> | |
Status: | CLOSED ERRATA | QA Contact: | Meina Li <meili> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 7.6 | CC: | dyuan, hhan, jdenemar, lmen, mtessun, tburke, xuzhang, yisun | |
Target Milestone: | rc | Keywords: | Regression | |
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-4.5.0-8.el7 | Doc Type: | No Doc Update | |
Doc Text: |
undefined
|
Story Points: | --- | |
Clone Of: | ||||
: | 1622534 (view as bug list) | Environment: | ||
Last Closed: | 2018-10-30 09:58:28 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: | 1622534 |
Description
Meina Li
2018-08-08 09:34:12 UTC
Posted a patch upstream: https://www.redhat.com/archives/libvir-list/2018-August/msg01135.html Testing: # virsh vol-info demo.luks default Name: demo.luks Type: file Capacity: 100.00 MiB Allocation: 256.00 KiB # virsh vol-dumpxml demo.luks default <volume type='file'> <name>demo.luks</name> <key>/home/vm-images/demo.luks</key> ... <encryption format='luks'> <secret type='passphrase' uuid='6fd3f62d-9fe7-4a4d-a869-7acd6376d8ea'/> </encryption> </target> </volume> # virsh vol-info bzvol.qcow2 default Name: bzvol.qcow2 Type: file Capacity: 100.00 MiB Allocation: 260.00 KiB # virsh vol-dumpxml bzvol.qcow2 default <volume type='file'> <name>bzvol.qcow2</name> <key>/home/vm-images/bzvol.qcow2</key> ... <target> ... <format type='qcow2'/> ... # virsh vol-resize demo.luks 50M default --shrink Size of volume 'demo.luks' successfully changed to 50M # virsh vol-resize demo.luks 100M default Size of volume 'demo.luks' successfully changed to 100M # virsh vol-resize bzvol.qcow2 50M default --shrink Size of volume 'bzvol.qcow2' successfully changed to 50M # virsh vol-resize bzvol.qcow2 100M default Size of volume 'bzvol.qcow2' successfully changed to 100M Patch pushed upstream: commit b04d1b6a35f9fb826f7bb83fdac364a127ec75ca Author: John Ferlan <jferlan> Date: Fri Aug 17 15:53:29 2018 -0400 storage: Add --shrink to qemu-img command when shrinking vol ... When shrinking the capacity of a qcow2 or luks volume using the qemu-img program, the --shrink qualifier must be added. Signed-off-by: John Ferlan <jferlan> Reviewed-by: Daniel P. Berrangé <berrange> ... $ git describe b04d1b6a35f9fb826f7bb83fdac364a127ec75ca v4.6.0-304-gb04d1b6a35 $ Verified on libvirt-4.5.0-9.el7.x86_64. Test steps: 1.Prepare an encrypted volume and a qcow2 volume. # virsh vol-dumpxml encrypt.luks default <volume type='file'> <name>encrypt.luks</name> <key>/var/lib/libvirt/images/encrypt.luks</key> ... <target> <path>/var/lib/libvirt/images/encrypt.luks</path> ... <encryption format='luks'> <secret type='passphrase' uuid='4d55f845-32f6-49e0-b5c8-f062f89955d4'/> </encryption> </target> </volume> # virsh vol-list default name path ------------------------------------------------------------------------------ encrypt.luks /var/lib/libvirt/images/encrypt.luks lmn.qcow2 /var/lib/libvirt/images/lmn.qcow2 noencrypt.qcow2 /var/lib/libvirt/images/noencrypt.qcow2 2. Check the capability of two volumes. # virsh vol-info encrypt.luks default Name: encrypt.luks Type: file Capability: 500.00 MiB Allocation: 256.00 KiB # virsh vol-info noencrypt.qcow2 default Name: noencrypt.qcow2 Type: file Capability: 500.00 MiB Allocation: 196.00 KiB 3. Resize the two volumes. # virsh vol-resize /var/lib/libvirt/images/encrypt.luks 300M --shrink Size of volume 'encrypt.luks' successfully changed to 300M # virsh vol-info encrypt.luks default Name: encrypt.luks Type: file Capability: 300.00 MiB Allocation: 256.00 KiB # virsh vol-resize noencrypt.qcow2 300M default --shrink Size of volume noencrypt.qcow2 successfully changed to 300M # virsh vol-info noencrypt.qcow2 default Name: noencrypt.qcow2 Type: file Capability: 300.00 MiB Allocation: 260.00 KiB 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://access.redhat.com/errata/RHSA-2018:3113 |