CLOUDSTACK-2932:

Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physical clean up required. It can land into error state only from allocated/Creating state
 which are states before creation on primary storage works
This commit is contained in:
Nitin Mehta 2014-02-05 17:34:48 -08:00
parent e51d472b0c
commit 86cada3b3c

View File

@ -197,6 +197,11 @@ public class XenserverSnapshotStrategy extends SnapshotStrategyBase {
return true;
}
if (Snapshot.State.Error.equals(snapshotVO.getState())) {
snapshotDao.remove(snapshotId);
return true;
}
if (snapshotVO.getState() == Snapshot.State.CreatedOnPrimary) {
s_logger.debug("delete snapshot on primary storage:");
snapshotVO.setState(Snapshot.State.Destroyed);