mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7754: Templates source_template_id is null when it is created from Snapshot with its corresponding volume removed. Fix it by searching for volumes including removed.
This commit is contained in:
parent
e796d418b4
commit
287ff83552
|
|
@ -1413,9 +1413,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||
|
||||
privateTemplate = _tmpltDao.findById(templateId);
|
||||
if (snapshotId != null) {
|
||||
//getting the prent volume
|
||||
//getting the parent volume
|
||||
long parentVolumeId = _snapshotDao.findById(snapshotId).getVolumeId();
|
||||
VolumeVO parentVolume = _volumeDao.findById(parentVolumeId);
|
||||
//Volume can be removed
|
||||
VolumeVO parentVolume = _volumeDao.findByIdIncludingRemoved(parentVolumeId);
|
||||
|
||||
if (parentVolume != null && parentVolume.getIsoId() != null && parentVolume.getIsoId() != 0) {
|
||||
privateTemplate.setSourceTemplateId(parentVolume.getIsoId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue