Skip to content

Commit 7ba6a75

Browse files
shwstpprdhslove
authored andcommitted
kvm: fix vm deployment with direct-download iso (apache#11532)
1 parent 871a82d commit 7ba6a75

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
@@ -101,9 +101,8 @@
101101
import org.apache.commons.lang3.StringUtils;
102102
import org.apache.commons.lang3.builder.ToStringBuilder;
103103
import org.apache.commons.lang3.builder.ToStringStyle;
104-
import org.apache.logging.log4j.Logger;
105104
import org.apache.logging.log4j.LogManager;
106-
105+
import org.apache.logging.log4j.Logger;
107106
import org.libvirt.Connect;
108107
import org.libvirt.Domain;
109108
import org.libvirt.DomainInfo;
@@ -3154,7 +3153,9 @@ public Answer handleDownloadTemplateToPrimaryStorage(DirectDownloadCommand cmd)
31543153
if (template != null) {
31553154
templatePath = template.getPath();
31563155
}
3157-
if (StringUtils.isEmpty(templatePath)) {
3156+
if (ImageFormat.ISO.equals(cmd.getFormat())) {
3157+
logger.debug("Skipping template validations as image format is {}", cmd.getFormat());
3158+
} else if (StringUtils.isEmpty(templatePath)) {
31583159
logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is empty", template.getName());
31593160
} else if (!new File(templatePath).exists()) {
31603161
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)