diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index a67316f5a1e..2c9ef825cba 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -676,7 +676,15 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager, // Either way delete the snapshots for this volume. List snapshots = listSnapsforVolume(volumeId); for (SnapshotVO snapshot : snapshots) { - if (_snapshotDao.expunge(snapshot.getId())) { + SnapshotVO snap = _snapshotDao.findById(snapshot.getId()); + SnapshotStrategy snapshotStrategy = null; + for (SnapshotStrategy strategy : snapshotStrategies) { + if (strategy.canHandle(snap)) { + snapshotStrategy = strategy; + break; + } + } + if (snapshotStrategy.deleteSnapshot(snapshot.getId())) { if (snapshot.getRecurringType() == Type.MANUAL) { _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.snapshot); _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage,