nvazquez commented on code in PR #10503: URL: https://github.com/apache/cloudstack/pull/10503#discussion_r2126980424
########## api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java: ########## @@ -816,6 +836,9 @@ public void execute() { @Override public void create() throws ResourceAllocationException { + if (!isVolumeOrSnapshotProvided() && templateId == null) { + throw new CloudRuntimeException("There isn't a ROOT volume, snapshot of ROOT volume or template provided to deploy a Virtual machine"); + } Review Comment: +1 a checkParameters method would be necessary to cover all the new supported cases + the existing one (only templateId set) ########## engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java: ########## @@ -255,16 +257,16 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String } } - _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), computeOffering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, - hypervisorType, extraDhcpOptionMap, dataDiskTemplateToDiskOfferingMap); + _itMgr.allocate(vm.getInstanceName(), _templateDao.findByIdIncludingRemoved(new Long(templateId)), computeOffering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, Review Comment: I think this can introduce some problems. Can this be refactored to search for the removed templates only in case it cannot find a template by ID and some new condition around volume and snapshot? -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org