From 07e5cbe81394fbd4e36d5ad2fff36cd8eea40a8e Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Tue, 11 Jun 2013 15:39:14 +0530 Subject: [PATCH] CLOUDSTACK-2932 Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physiocal clean up required --- .../storage/snapshot/strategy/AncientSnapshotStrategy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java index 9e666d21515..4aba3d919b5 100644 --- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java +++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java @@ -536,6 +536,11 @@ public class AncientSnapshotStrategy implements SnapshotStrategy { Long snapshotId = snapInfo.getId(); SnapshotObject snapshot = (SnapshotObject)snapInfo; + if (Snapshot.State.Error.equals(snapshot.getState())) { + _snapshotDao.remove(snapshotId); + return true; + } + if (!Snapshot.State.BackedUp.equals(snapshot.getState())) { throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status"); }