Bug 1021802
Summary: | virsh vol-resize does not shrink volume | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | chandrashekar shastri <cshastri> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | alex.mail.1534, berrange, cristiandeives, jtomko, libvirt-maint, rbalakri, shyu |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-18 07:58:53 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
chandrashekar shastri
2013-10-22 06:52:48 UTC
libvirt-1.1.3.4-4.fc20.x86_64 -- still Any update on this bug? Afraid it looks like it is still broken in master. It was trivial to make this work for plain raw files, but it isn't currently doable for qcow2 https://www.redhat.com/archives/libvir-list/2015-January/msg00552.html commit aa9aa6a97521ca38008f7c8d2e5cbb1abc821032 Author: Daniel P. Berrange <berrange> AuthorDate: 2015-01-15 16:40:31 +0000 Commit: Daniel P. Berrange <berrange> CommitDate: 2015-02-12 11:11:52 +0000 Allow shrinking of file based volumes While the main storage driver code allows the flag VIR_STORAGE_VOL_RESIZE_SHRINK to be set, none of the backend drivers are supporting it. At the very least this can work for plain file based volumes since we just ftruncate() them to the new size. It does not work with qcow2 volumes, but we can arguably delegate to qemu-img for error reporting for that instead of second guessing this for ourselves: $ virsh vol-resize --shrink /home/berrange/VirtualMachines/demo.qcow2 2G error: Failed to change size of volume 'demo.qcow2' to 2G error: internal error: Child process (/usr/bin/qemu-img resize /home/berrange/VirtualMachines/demo.qcow2 2147483648) unexpected exit status 1: qemu-img: qcow2 doesn't support shrinking images yet qemu-img: This image does not support resize See also https://bugzilla.redhat.com/show_bug.cgi?id=1021802 git describe: v1.2.12-123-gaa9aa6a contains: v1.2.13-rc1~76 |