Repository: cloudstack Updated Branches: refs/heads/4.4 f0893d579 -> fbb637791
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/fbb63779 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fbb63779 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fbb63779 Branch: refs/heads/4.4 Commit: fbb637791c53b1d7dee18506b8427befa30100fd Parents: f0893d5 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:27 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/fbb63779/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 4f2067c..484505c 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 @@ -1855,8 +1855,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/fbb63779/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
