JoaoJandre commented on code in PR #9270:
URL: https://github.com/apache/cloudstack/pull/9270#discussion_r1726999516
##########
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
##########
@@ -522,6 +522,21 @@ public Void
deleteVolumeCallback(AsyncCallbackDispatcher<VolumeServiceImpl, Comm
return null;
}
+ /**
+ * Deletes the snapshot from primary storage if the only storage
associated with the snapshot is of the Primary role; else, just removes the
primary record on the DB.
+ * */
+ protected void deleteKvmSnapshotOnPrimary(SnapshotDataStoreVO
snapshotDataStoreVO) {
+ List<SnapshotDataStoreVO> snapshotDataStoreVOList =
_snapshotStoreDao.findBySnapshotId(snapshotDataStoreVO.getSnapshotId());
+ for (SnapshotDataStoreVO snapshotStore : snapshotDataStoreVOList) {
+ if (DataStoreRole.Image.equals(snapshotStore.getRole())) {
+ _snapshotStoreDao.remove(snapshotDataStoreVO.getId());
+ return;
+ }
+ }
+
+ snapshotApiService.deleteSnapshot(snapshotDataStoreVO.getSnapshotId(),
null);
Review Comment:
They are currently marked as deleted and stay on storage as garbage, this
was added to clean the garbage.
##########
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
##########
@@ -504,10 +504,10 @@ public Void
deleteVolumeCallback(AsyncCallbackDispatcher<VolumeServiceImpl, Comm
if (!supportsStorageSystemSnapshots) {
_snapshotStoreDao.remove(snapStoreVo.getId());
}
- } else {
- if
(!StoragePoolType.StorPool.equals(storagePoolVO.getPoolType())) {
- _snapshotStoreDao.remove(snapStoreVo.getId());
- }
+ } else if
(HypervisorType.KVM.equals(vo.getHypervisorType())) {
Review Comment:
@slavkap I was under the impression that StorPool was a managed storage, but
upon further inspection I found that it actually is not. However, this made
me question, what does cloudstack consider a managed storage? Shouldn't
StorPool/Linstor/SolidFire be considered managed storages for example?
I've changed this so that the StorPool behavior stays the same.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]