Skip to content

Commit 762f75c

Browse files
authored
kvm: fix vm deployment with direct-download iso (#11532)
1 parent ca62a7d commit 762f75c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@
8484
import org.apache.commons.lang3.StringUtils;
8585
import org.apache.commons.lang3.builder.ToStringBuilder;
8686
import org.apache.commons.lang3.builder.ToStringStyle;
87-
import org.apache.logging.log4j.Logger;
8887
import org.apache.logging.log4j.LogManager;
89-
88+
import org.apache.logging.log4j.Logger;
9089
import org.libvirt.Connect;
9190
import org.libvirt.Domain;
9291
import org.libvirt.DomainInfo;
@@ -2476,7 +2475,9 @@ public Answer handleDownloadTemplateToPrimaryStorage(DirectDownloadCommand cmd)
24762475
if (template != null) {
24772476
templatePath = template.getPath();
24782477
}
2479-
if (StringUtils.isEmpty(templatePath)) {
2478+
if (ImageFormat.ISO.equals(cmd.getFormat())) {
2479+
logger.debug("Skipping template validations as image format is {}", cmd.getFormat());
2480+
} else if (StringUtils.isEmpty(templatePath)) {
24802481
logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is empty", template.getName());
24812482
} else if (!new File(templatePath).exists()) {
24822483
logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is not valid: {}", template.getName(), templatePath);

0 commit comments

Comments
 (0)