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
* 4.13:
Snapshot deletion issues (#3969)
server: Cannot list affinity group if there are hosts dedicated… (#4025)
server: Search zone-wide storage pool when allocation algothrim is firstfitleastconsumed (#4002)
// Here we handle snapshots which are to be deleted but are not marked as destroyed yet.
288
+
// This may occur for instance when they are created only on primary because
289
+
// snapshot.backup.to.secondary was set to false.
290
+
if (snapshotOnPrimaryInfo == null) {
291
+
if (s_logger.isDebugEnabled()) {
292
+
s_logger.debug(String.format("Snapshot (id: %d) not found on primary storage, skipping snapshot deletion on primary and marking it destroyed", snapshotId));
String.format("Failed to find/delete snapshot (id: %d) on secondary storage. Still necessary to check and delete snapshot on primary storage.",
328
+
snapshotId));
329
+
} else {
330
+
s_logger.debug(String.format("Snapshot (id: %d) has been deleted on secondary storage.", snapshotId));
316
331
}
332
+
} catch (NoTransitionExceptione) {
333
+
s_logger.debug("Failed to set the state to destroying: ", e);
334
+
// deletedOnSecondary remain null
317
335
}
318
-
} catch (Exceptione) {
319
-
s_logger.debug("Failed to delete snapshot: ", e);
336
+
}
337
+
returndeletedOnSecondary;
338
+
}
339
+
340
+
/**
341
+
* Deletes the snapshot on secondary storage.
342
+
* It can return false when the snapshot was stored on primary storage and not backed up on secondary; therefore, the snapshot should also be deleted on primary storage even when this method returns false.
* Deletes the snapshot on primary storage. It returns true when the snapshot was not found on primary storage; </br>
365
+
* In case of failure while deleting the snapshot, it will throw one of the following exceptions: CloudRuntimeException, InterruptedException, or ExecutionException. </br>
s_logger.debug(String.format("Snapshot reference is found on primary storage for snapshot id: %d, performing snapshot deletion on primary", snapshotId));
372
+
}
373
+
if (snapshotSvr.deleteSnapshot(snapshotOnPrimaryInfo)) {
s_logger.debug(String.format("Successfully deleted snapshot id: %d on primary storage", snapshotId));
378
+
}
379
+
returntrue;
324
380
}
325
-
returnfalse;
381
+
} else {
382
+
if (s_logger.isDebugEnabled()) {
383
+
s_logger.debug(String.format("Snapshot reference is not found on primary storage for snapshot id: %d, skipping snapshot deletion on primary", snapshotId));
384
+
}
385
+
returntrue;
326
386
}
387
+
returnfalse;
388
+
}
327
389
328
-
returntrue;
390
+
/**
391
+
* Returns true if the snapshot volume is on primary storage.
Copy file name to clipboardExpand all lines: engine/storage/snapshot/src/main/resources/META-INF/cloudstack/storage/spring-engine-storage-snapshot-storage-context.xml
0 commit comments