harikrishna-patnala commented on code in PR #9239: URL: https://github.com/apache/cloudstack/pull/9239#discussion_r1644355413
########## server/src/main/java/org/apache/cloudstack/snapshot/SnapshotHelper.java: ########## @@ -101,15 +101,21 @@ public void expungeTemporarySnapshot(boolean kvmSnapshotOnlyInPrimaryStorage, Sn return; } - logger.debug(String.format("Expunging snapshot [%s] due to it is a temporary backup to create a volume from snapshot. It is occurring because the global setting [%s]" - + " has the value [%s].", snapInfo.getId(), SnapshotInfo.BackupSnapshotAfterTakingSnapshot.key(), backupSnapshotAfterTakingSnapshot)); - - try { - snapshotService.deleteSnapshot(snapInfo); - } catch (CloudRuntimeException ex) { - logger.warn(String.format("Unable to delete the temporary snapshot [%s] on secondary storage due to [%s]. We still will expunge the database reference, consider" - + " manually deleting the file [%s].", snapInfo.getId(), ex.getMessage(), snapInfo.getPath()), ex); + if (!DataStoreRole.Image.equals(snapInfo.getDataStore().getRole())) { Review Comment: Datastore/Role cannot be null based on the existing method calls and it should be null for further steps as well. Do you want me to keep a check anyways ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org