Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@
import com.cloud.storage.StoragePoolStatus;
import com.cloud.storage.VMTemplateStorageResourceAssoc;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.VMTemplateZoneVO;
import com.cloud.storage.Volume;
import com.cloud.storage.VolumeApiService;
import com.cloud.storage.VolumeVO;
Expand Down Expand Up @@ -4413,10 +4412,12 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri
if (template.getTemplateType().equals(TemplateType.SYSTEM) && !CKS_NODE.equals(vmType) && !SHAREDFSVM.equals(vmType)) {
throw new InvalidParameterValueException(String.format("Unable to use system template %s to deploy a user vm", template));
}
List<VMTemplateZoneVO> listZoneTemplate = _templateZoneDao.listByZoneTemplate(zone.getId(), template.getId());
if (listZoneTemplate == null || listZoneTemplate.isEmpty()) {
throw new InvalidParameterValueException(String.format("The template %s is not available for use", template));
}

// apache#9873 ) kvm-default-vm-import-dummy-template 을 이용한 가상머신 생성을 위해 임시 주석처리
// List<VMTemplateZoneVO> listZoneTemplate = _templateZoneDao.listByZoneTemplate(zone.getId(), template.getId());
// if (listZoneTemplate == null || listZoneTemplate.isEmpty()) {
// throw new InvalidParameterValueException(String.format("The template %s is not available for use", template));
// }

if (isIso && !template.isBootable()) {
throw new InvalidParameterValueException(String.format("Installing from ISO requires an ISO that is bootable: %s", template));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ private List<String> getAllowedInternalSiteCidrs() {
for (String cidr : cidrs) {
if (NetUtils.isValidIp4Cidr(cidr) && !cidr.startsWith("0.0.0.0")) {
if (! NetUtils.getCleanIp4Cidr(cidr).equals(cidr)) {
s_logger.warn(String.format("Invalid CIDR %s in %s", cidr, SecStorageAllowedInternalDownloadSites.key()));
logger.warn(String.format("Invalid CIDR %s in %s", cidr, SecStorageAllowedInternalDownloadSites.key()));
}
allowedCidrs.add(NetUtils.getCleanIp4Cidr(cidr));
} else if (NetUtils.isValidIp4(cidr) && !cidr.startsWith("0.0.0.0")) {
s_logger.warn(String.format("Ip address is not a valid CIDR; %s consider using %s/32", cidr, cidr));
logger.warn(String.format("Ip address is not a valid CIDR; %s consider using %s/32", cidr, cidr));
allowedCidrs.add(cidr);
}
}
Expand Down
Loading