Skip to content

Commit 07e5cbe

Browse files
committed
CLOUDSTACK-2932
Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physiocal clean up required
1 parent 7b63894 commit 07e5cbe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,11 @@ public boolean deleteSnapshot(SnapshotInfo snapInfo) {
536536
Long snapshotId = snapInfo.getId();
537537
SnapshotObject snapshot = (SnapshotObject)snapInfo;
538538

539+
if (Snapshot.State.Error.equals(snapshot.getState())) {
540+
_snapshotDao.remove(snapshotId);
541+
return true;
542+
}
543+
539544
if (!Snapshot.State.BackedUp.equals(snapshot.getState())) {
540545
throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status");
541546
}

0 commit comments

Comments
 (0)