CLOUDSTACK-8263: KVM - use virsh instead of libvirt for resizing qcow2, as libvirt bindings are insufficient

Change-Id: I08246219cb1469a46dc6a9ec76a8c3a67b0b8bf6
This commit is contained in:
Marcus Sorensen 2015-02-17 18:09:41 -08:00
parent ed8184a5b2
commit 9bf2626e57
2 changed files with 3 additions and 3 deletions

View File

@ -1878,8 +1878,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
s_logger.debug("Resizing volume: " + path + "," + currentSize + "," + newSize + "," + type + "," + vmInstanceName + "," + shrinkOk); 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 */ /* 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) { 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."); s_logger.debug("Volume " + path + " can be resized by libvirt. Asking libvirt to resize the volume.");
try { try {
Connect conn = LibvirtConnection.getConnection(); Connect conn = LibvirtConnection.getConnection();

View File

@ -244,7 +244,7 @@ then
resizelvm resizelvm
elif [ "$ptype" == "QCOW2" ] elif [ "$ptype" == "QCOW2" ]
then then
resizeqcow2 notifyqemu
elif [ "$ptype" == "NOTIFYONLY" ] elif [ "$ptype" == "NOTIFYONLY" ]
then then
notifyqemu notifyqemu