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 c6603f55e6a..20d709322c6 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -1878,8 +1878,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(); diff --git a/scripts/storage/qcow2/resizevolume.sh b/scripts/storage/qcow2/resizevolume.sh index bc763d07211..1e6ffd648f5 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