You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/src/main/java/org/apache/cloudstack/snapshot/SnapshotHelper.java
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -101,15 +101,21 @@ public void expungeTemporarySnapshot(boolean kvmSnapshotOnlyInPrimaryStorage, Sn
101
101
return;
102
102
}
103
103
104
-
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]"
105
-
+ " has the value [%s].", snapInfo.getId(), SnapshotInfo.BackupSnapshotAfterTakingSnapshot.key(), backupSnapshotAfterTakingSnapshot));
106
-
107
-
try {
108
-
snapshotService.deleteSnapshot(snapInfo);
109
-
} catch (CloudRuntimeExceptionex) {
110
-
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"
if (!snapInfo.getDataStore().getRole().equals(DataStoreRole.Image)) {
105
+
logger.debug(String.format("Expunge template for Snapshot [%s] is called for primary storage role. Not expunging it, " +
106
+
"but we will still expunge the database reference of the snapshot for image storage role if any", snapInfo.getId()));
107
+
} else {
108
+
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]"
109
+
+ " has the value [%s].", snapInfo.getId(), SnapshotInfo.BackupSnapshotAfterTakingSnapshot.key(), backupSnapshotAfterTakingSnapshot));
110
+
111
+
try {
112
+
snapshotService.deleteSnapshot(snapInfo);
113
+
} catch (CloudRuntimeExceptionex) {
114
+
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"
0 commit comments