bug 6499: If there is volume created from this template, this template can't be delete from secondary storage, it can be removed from DB

status 6499: resolved fixed
This commit is contained in:
anthony 2010-10-11 12:59:46 -07:00
parent b0a3f329a0
commit 3dd7ed7fc6
1 changed files with 3 additions and 0 deletions

View File

@ -633,6 +633,9 @@ public class TemplateManagerImpl implements TemplateManager {
// Check if there are any snapshots for the template in the template host ref's zone
List<VolumeVO> volumes = _volumeDao.findByTemplateAndZone(templateId, zoneId);
if( volumes.size() > 0 ) {
return false;
}
for (VolumeVO volume : volumes) {
List<SnapshotVO> snapshots = _snapshotDao.listByVolumeId(volume.getId());
if (!snapshots.isEmpty()) {