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.
(cherry picked from commit 287ff83552)
This commit is contained in:
parent
3db112f75c
commit
a72580def0
|
|
@ -1410,9 +1410,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