slavkap commented on code in PR #10632: URL: https://github.com/apache/cloudstack/pull/10632#discussion_r2200376821
########## 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: Hi @JoaoJandre, just a question here - from what I got till now, your feature creates external snapshots, right? Aren't the disk snapshots (take volume snapshot) also external? If both are external, how will this erase the VM snapshots? -- 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