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


##########
server/src/main/java/org/apache/cloudstack/snapshot/SnapshotHelper.java:
##########
@@ -264,4 +264,12 @@ protected Set<Long> 
getSnapshotIdsOnlyInPrimaryStorage(long volumeId) {
 
         return snapshotIdsOnlyInPrimaryStorage;
     }
+
+    public SnapshotInfo convertSnapshotIfNeeded(SnapshotInfo snapshotInfo) {
+        if (snapshotInfo.getParent() == null || 
!HypervisorType.KVM.equals(snapshotInfo.getHypervisorType())) {
+            return snapshotInfo;
+        }
+
+        return snapshotService.convertSnapshot(snapshotInfo);

Review Comment:
   @JoaoJandre, the last time I didn't see this but the converted snapshot is 
left on the secondary storage and fills the space.
   
   ```
   [root@lab-cs-test-mgmt export]# ls -latr secondary-a/snapshots/2/1078/
   total 10542184
   -rw-r--r--. 1 root root 2188509184 28 авг 13,14 
c453378b-ac77-4423-9667-5f76273ccd11
   -rw-r--r--. 1 root root 2188509184 28 авг 13,17 
c25da6f2-636c-4d21-a55d-e2174d0e24c5
   -rw-r--r--. 1 root root 2112880640 28 авг 13,18 
c25da6f2-636c-4d21-a55d-e2174d0e24c5_temp
   drwxr-xr-x. 4 root root         29 28 авг 13,49 ..
   -rw-r--r--. 1 root root 2188509184 28 авг 13,54 
8db99bcd-3969-4314-8037-ddd2fd9a797e
   drwxr-xr-x. 2 root root        236 28 авг 13,54 .
   -rw-r--r--. 1 root root 2112880640 28 авг 13,55 
8db99bcd-3969-4314-8037-ddd2fd9a797e_temp
   ```
   
   



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