Repository: cloudstack Updated Branches: refs/heads/4.5 61a50ce5e -> e77b4ae8e
CLOUDSTACK-8263: KVM - use virsh instead of libvirt for resizing qcow2, as libvirt bindings are insufficient Change-Id: I08246219cb1469a46dc6a9ec76a8c3a67b0b8bf6 Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e77b4ae8 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e77b4ae8 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e77b4ae8 Branch: refs/heads/4.5 Commit: e77b4ae8e84b55e324a9e1f4b361476940a8fed1 Parents: 61a50ce Author: Marcus Sorensen <[email protected]> Authored: Tue Feb 17 18:09:41 2015 -0800 Committer: Marcus Sorensen <[email protected]> Committed: Tue Feb 17 18:10:08 2015 -0800 ---------------------------------------------------------------------- .../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java | 4 ++-- scripts/storage/qcow2/resizevolume.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e77b4ae8/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 950e1c2..868d829 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -1877,8 +1877,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv s_logger.debug("Resizing volume: " + path + "," + currentSize + "," + newSize + "," + type + "," + vmInstanceName + "," + shrinkOk); - /* libvirt doesn't support resizing (C)LVM devices, so we have to do that via a Bash script */ - if (pool.getType() != StoragePoolType.CLVM) { + /* libvirt doesn't support resizing (C)LVM devices, and corrupts QCOW2 in some scenarios, so we have to do these via Bash script */ + if (pool.getType() != StoragePoolType.CLVM && vol.getFormat() != PhysicalDiskFormat.QCOW2) { s_logger.debug("Volume " + path + " can be resized by libvirt. Asking libvirt to resize the volume."); try { Connect conn = LibvirtConnection.getConnection(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e77b4ae8/scripts/storage/qcow2/resizevolume.sh ---------------------------------------------------------------------- diff --git a/scripts/storage/qcow2/resizevolume.sh b/scripts/storage/qcow2/resizevolume.sh index bc763d0..1e6ffd6 100755 --- a/scripts/storage/qcow2/resizevolume.sh +++ b/scripts/storage/qcow2/resizevolume.sh @@ -244,7 +244,7 @@ then resizelvm elif [ "$ptype" == "QCOW2" ] then - resizeqcow2 + notifyqemu elif [ "$ptype" == "NOTIFYONLY" ] then notifyqemu
