DaanHoogland commented on a change in pull request #5216:
URL: https://github.com/apache/cloudstack/pull/5216#discussion_r692793605
##########
File path: server/src/main/java/com/cloud/template/TemplateManagerImpl.java
##########
@@ -1742,6 +1744,272 @@ public void
doInTransactionWithoutResult(TransactionStatus status) {
}
}
+ @Override
+ @DB
+ @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE,
eventDescription = "creating actual private template", create = true)
+ public VirtualMachineTemplate createPrivateTemplate(CloneVMCmd cmd, long
snapshotId, long templateId) throws CloudRuntimeException {
+ UserVm curVm = cmd.getTargetVM();
+ final Long accountId = curVm.getAccountId();
+ Account caller = CallContext.current().getCallingAccount();
+ List<VolumeVO> volumes = _volumeDao.findByInstanceAndType(cmd.getId(),
Volume.Type.ROOT);
+ VolumeVO targetVolume = volumes.get(0);
+ long volumeId = targetVolume.getId();
+ VMTemplateVO finalTmpProduct = null;
+ SnapshotVO snapshot = null;
+ try {
+ TemplateInfo cloneTempalateInfp =
_tmplFactory.getTemplate(templateId, DataStoreRole.Image);
+ long zoneId = curVm.getDataCenterId();
+ AsyncCallFuture<TemplateApiResult> future = null;
+ VolumeInfo vInfo = _volFactory.getVolume(volumeId);
+ DataStore store =
_dataStoreMgr.getImageStoreWithFreeCapacity(zoneId);
+ snapshot = _snapshotDao.findById(snapshotId);
+// future = _tmpltSvr.createTemplateFromVolumeAsync(vInfo,
cloneTempalateInfp, store);
Review comment:
```suggestion
```
--
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]