sureshanaparti commented on code in PR #14515:
URL: https://github.com/apache/cloudstack/pull/14515#discussion_r4703910311


##########
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java:
##########
@@ -133,8 +134,12 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) {
     @Override
     public boolean deleteVMSnapshot(VMSnapshot vmSnapshot) {
         logger.info("Starting VM snapshot delete process for snapshot [{}].", 
vmSnapshot.getUuid());
-        UserVmVO userVm = userVmDao.findById(vmSnapshot.getVmId());
         VMSnapshotVO vmSnapshotBeingDeleted = (VMSnapshotVO) vmSnapshot;
+        if (!hasVolumeSnapshotDetails(vmSnapshotBeingDeleted)) {
+            return 
deleteVMSnapshotWithoutVolumeSnapshots(vmSnapshotBeingDeleted);
+        }
+
+        UserVmVO userVm = userVmDao.findById(vmSnapshot.getVmId());
         Long hostId = pickHostForNvramSidecarCleanup(vmSnapshotBeingDeleted, 
userVm, "delete");
         validateHostSupportsNvramSidecarCleanup(vmSnapshotBeingDeleted, 
hostId, "delete");

Review Comment:
   Addressed in c8da86e. The metadata-only path is gated on the absence of 
volume-snapshot details and the NVRAM sidecar path; an NVRAM-only row takes the 
host-side delete.



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

Reply via email to