mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8263: KVM - use virsh instead of libvirt for resizing qcow2, as libvirt bindings are insufficient
Change-Id: I08246219cb1469a46dc6a9ec76a8c3a67b0b8bf6
This commit is contained in:
parent
ed8184a5b2
commit
9bf2626e57
@ -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();
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user