kvm: fix vm deployment with direct-download iso (#11532)

This commit is contained in:
Abhishek Kumar 2025-08-29 18:42:59 +05:30 committed by GitHub
parent ca62a7dd50
commit 762f75c041
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,9 +84,8 @@ import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.libvirt.Connect; import org.libvirt.Connect;
import org.libvirt.Domain; import org.libvirt.Domain;
import org.libvirt.DomainInfo; import org.libvirt.DomainInfo;
@ -2476,7 +2475,9 @@ public class KVMStorageProcessor implements StorageProcessor {
if (template != null) { if (template != null) {
templatePath = template.getPath(); templatePath = template.getPath();
} }
if (StringUtils.isEmpty(templatePath)) { if (ImageFormat.ISO.equals(cmd.getFormat())) {
logger.debug("Skipping template validations as image format is {}", cmd.getFormat());
} else if (StringUtils.isEmpty(templatePath)) {
logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is empty", template.getName()); logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is empty", template.getName());
} else if (!new File(templatePath).exists()) { } else if (!new File(templatePath).exists()) {
logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is not valid: {}", template.getName(), templatePath); logger.warn("Skipped validation whether downloaded file is QCOW2 for template {}, due to downloaded template path is not valid: {}", template.getName(), templatePath);