Skip to content

Commit 96b8e23

Browse files
kvm: fix vm deployment from RAW template (#10880)
* kvm: fix vm deployment from RAW template * Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java Co-authored-by: João Jandre <[email protected]> --------- Co-authored-by: João Jandre <[email protected]>
1 parent 842b2f8 commit 96b8e23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,9 @@ to support snapshots(backuped) as qcow2 files. */
16091609
} else {
16101610
destFile = new QemuImgFile(destPath, destFormat);
16111611
try {
1612-
qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), null, false, true);
1612+
boolean isQCOW2 = PhysicalDiskFormat.QCOW2.equals(sourceFormat);
1613+
qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null),
1614+
null, false, isQCOW2);
16131615
Map<String, String> destInfo = qemu.info(destFile);
16141616
Long virtualSize = Long.parseLong(destInfo.get(QemuImg.VIRTUAL_SIZE));
16151617
newDisk.setVirtualSize(virtualSize);

0 commit comments

Comments
 (0)