diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java index 6decb945496..900c02e7c01 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java @@ -162,13 +162,6 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd { description = "true if template should bypass Secondary Storage and be downloaded to Primary Storage on deployment") private Boolean directDownload; - @Parameter(name= ApiConstants.DEPLOY_AS_IS, - type = CommandType.BOOLEAN, - description = "VMware only: true if template should not strip and define disks and networks but leave those to the template definition", - since = "4.15" - ) - private Boolean deployAsIs; - ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -282,7 +275,7 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd { } public Boolean isDeployAsIs() { - return deployAsIs == null ? false : deployAsIs; + return hypervisor != null && hypervisor.equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString()); } ///////////////////////////////////////////////////// @@ -347,9 +340,5 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameter directdownload is only allowed for KVM templates"); } - - if (isDeployAsIs() && !getHypervisor().equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString())) { - throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameter deployasis is only allowed for VMware templates"); - } } } diff --git a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java index 92072c7a3c5..a8ae39fc6eb 100644 --- a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java @@ -253,7 +253,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation deployAsIsDetails = templateDeployAsIsDetailsDao.listDetails(template.getId()); for (TemplateDeployAsIsDetailVO deployAsIsDetailVO : deployAsIsDetails) { if (deployAsIsDetailVO.getName().startsWith(DeployAsIsConstants.HARDWARE_ITEM_PREFIX)) { diff --git a/server/src/main/java/com/cloud/api/query/vo/TemplateJoinVO.java b/server/src/main/java/com/cloud/api/query/vo/TemplateJoinVO.java index 91bb76336cc..25e3b0b5ff5 100644 --- a/server/src/main/java/com/cloud/api/query/vo/TemplateJoinVO.java +++ b/server/src/main/java/com/cloud/api/query/vo/TemplateJoinVO.java @@ -231,9 +231,6 @@ public class TemplateJoinVO extends BaseViewWithTagInformationVO implements Cont @Column(name = "direct_download") private boolean directDownload; - @Column(name = "deploy_as_is") - private boolean deployAsIs; - public TemplateJoinVO() { } @@ -493,10 +490,6 @@ public class TemplateJoinVO extends BaseViewWithTagInformationVO implements Cont return directDownload; } - public boolean isDeployAsIs() { - return deployAsIs; - } - public Object getParentTemplateId() { return parentTemplateId; }