mirror of https://github.com/apache/cloudstack.git
bug 7161 : Fixed CreatePrivateTemplate NPE. This was getting thrown when template creation was ordered from a volume for hypervisor other than KVM. For now we support template creation from volume only for KVM. The bug was more due to conversion of Long to long where the Long object was null.
status 7161: resolved fixed
This commit is contained in:
parent
fe1f2824a4
commit
06a1e47fb3
4
server/src/com/cloud/async/executor/CreatePrivateTemplateExecutor.java
Normal file → Executable file
4
server/src/com/cloud/async/executor/CreatePrivateTemplateExecutor.java
Normal file → Executable file
|
|
@ -121,10 +121,12 @@ public class CreatePrivateTemplateExecutor extends VolumeOperationExecutor {
|
|||
// For template snapshot, we use a separate snapshot method.
|
||||
snapshot = vmMgr.createTemplateSnapshot(param.getUserId(), param.getVolumeId());
|
||||
}
|
||||
else {
|
||||
else if (snapshotId != null){
|
||||
// We are creating a private template from an already present snapshot.
|
||||
// This snapshot is already backed up on secondary storage.
|
||||
snapshot = managerServer.findSnapshotById(snapshotId);
|
||||
}else{
|
||||
throw new CloudRuntimeException("Do not support create template from volume at this moment for hypervisor:" +managerServer.getHyperType());
|
||||
}
|
||||
|
||||
if (snapshot == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue