slavkap commented on code in PR #10632:
URL: https://github.com/apache/cloudstack/pull/10632#discussion_r2200516109


##########
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/DefaultSnapshotStrategy.java:
##########
@@ -626,6 +646,30 @@ public StrategyPriority canHandle(Snapshot snapshot, Long 
zoneId, SnapshotOperat
         return StrategyPriority.DEFAULT;
     }
 
+    private StrategyPriority validateVmSnapshot(Snapshot snapshot) {
+        VolumeVO volumeVO = volumeDao.findById(snapshot.getVolumeId());
+        Long instanceId = volumeVO.getInstanceId();
+        if (instanceId == null) {
+            return StrategyPriority.DEFAULT;
+        }
+
+        VMInstanceVO vm = vmInstanceDao.findById(instanceId);
+        if (vm == null) {
+            return StrategyPriority.DEFAULT;
+        }
+
+        for (VMSnapshotVO vmSnapshotVO : 
vmSnapshotDao.findByVmAndByType(vm.getId(), VMSnapshot.Type.Disk)) {
+            List<VMSnapshotDetailsVO> vmSnapshotDetails = 
vmSnapshotDetailsDao.listDetails(vmSnapshotVO.getId());
+            if (vmSnapshotDetails.stream().anyMatch(vmSnapshotDetailsVO -> 
vmSnapshotDetailsVO.getName().equals(VolumeApiServiceImpl.KVM_FILE_BASED_STORAGE_SNAPSHOT)))
 {
+                logger.warn("VM [{}] already has KVM File-Based storage VM 
snapshots. These VM snapshots and volume snapshots are not supported " +

Review Comment:
   Thanks, @JoaoJandre, for the explanation! I've missed that could cause a 
problem with the synchronisation of the delta here



-- 
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

Reply via email to