mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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 <48719461+JoaoJandre@users.noreply.github.com> --------- Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
This commit is contained in:
parent
842b2f8c24
commit
96b8e23767
@ -1609,7 +1609,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||||||
} else {
|
} else {
|
||||||
destFile = new QemuImgFile(destPath, destFormat);
|
destFile = new QemuImgFile(destPath, destFormat);
|
||||||
try {
|
try {
|
||||||
qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), null, false, true);
|
boolean isQCOW2 = PhysicalDiskFormat.QCOW2.equals(sourceFormat);
|
||||||
|
qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null),
|
||||||
|
null, false, isQCOW2);
|
||||||
Map<String, String> destInfo = qemu.info(destFile);
|
Map<String, String> destInfo = qemu.info(destFile);
|
||||||
Long virtualSize = Long.parseLong(destInfo.get(QemuImg.VIRTUAL_SIZE));
|
Long virtualSize = Long.parseLong(destInfo.get(QemuImg.VIRTUAL_SIZE));
|
||||||
newDisk.setVirtualSize(virtualSize);
|
newDisk.setVirtualSize(virtualSize);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user