nvazquez commented on code in PR #12499:
URL: https://github.com/apache/cloudstack/pull/12499#discussion_r2716464156


##########
server/src/main/java/com/cloud/template/TemplateManagerImpl.java:
##########
@@ -2172,6 +2176,11 @@ private VMTemplateVO 
updateTemplateOrIso(BaseUpdateTemplateOrIsoCmd cmd) {
             templateType = validateTemplateType(cmd, isAdmin, 
template.isCrossZones());
             if (cmd instanceof UpdateVnfTemplateCmd) {
                 VnfTemplateUtils.validateApiCommandParams(cmd, template);
+                UpdateVnfTemplateCmd updateCmd = (UpdateVnfTemplateCmd) cmd;
+                if (template.isDeployAsIs() && 
CollectionUtils.isNotEmpty(updateCmd.getVnfNics())) {

Review Comment:
   Why is this parameter allowed on update but not on VM creation? 
(https://github.com/apache/cloudstack/pull/12499/files#diff-f5ab861d900497f6f7c83d03a840a7994f407c2dd52c237a4b560aaf9e75c202R128)



##########
server/src/main/java/org/apache/cloudstack/storage/template/VnfTemplateManagerImpl.java:
##########
@@ -213,6 +216,19 @@ public void 
validateVnfApplianceNics(VirtualMachineTemplate template, List<Long>
         }
     }
 
+    @Override
+    public void validateVnfApplianceNetworksMap(VirtualMachineTemplate 
template, Map<Integer, Long> vmNetworkMap) {
+        if (MapUtils.isEmpty(vmNetworkMap)) {
+            throw new InvalidParameterValueException("VNF networks map is 
empty");
+        }
+        List<VnfTemplateNicVO> vnfNics = 
vnfTemplateNicDao.listByTemplateId(template.getId());
+        for (VnfTemplateNicVO vnfNic : vnfNics) {
+            if (vnfNic.isRequired() && vmNetworkMap.size() <= 
vnfNic.getDeviceId()) {

Review Comment:
   +1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to