syed commented on a change in pull request #2585: Add ability to archive
snapshots on primary storage
URL: https://github.com/apache/cloudstack/pull/2585#discussion_r188848284
##########
File path:
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
##########
@@ -281,7 +282,13 @@ public SnapshotInfo backupSnapshot(SnapshotInfo snapshot)
{
s_logger.debug("Failed to copy snapshot", e);
result.setResult("Failed to copy snapshot:" + e.toString());
try {
- snapObj.processEvent(Snapshot.Event.OperationFailed);
+ // When error archiving an already existing snapshot, emit
OperationNotPerformed.
+ // This will ensure that the original snapshot does not get
deleted
+ if (origState.equals(Snapshot.State.BackedUp)) {
Review comment:
@mike-tutkowski Yes. That is how I added this check. In the normal scenario,
the original snapshot was getting deleted.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services