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


##########
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:
##########
@@ -1502,6 +1579,29 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) 
throws ResourceAllocationExc
         return snapshot;
     }
 
+    private void postSnapshotDirectlyToSecondary(SnapshotInfo snapshot, 
SnapshotInfo snapshotOnPrimary, Long snapshotId) {
+        logger.debug("{} was directly copied to secondary storage because the 
hypervisor is KVM, the primary storage is file-based and the [{}] 
configuration" +
+                " is set to true.", snapshot.getSnapshotVO().toString(), 
SnapshotInfo.BackupSnapshotAfterTakingSnapshot);
+
+        SnapshotDataStoreVO snapshotStore = 
_snapshotStoreDao.findBySnapshotIdAndDataStoreRoleAndState(snapshotId, 
DataStoreRole.Image, ObjectInDataStoreStateMachine.State.Allocated);
+
+        snapshotStore.setInstallPath(snapshotOnPrimary.getPath());

Review Comment:
   @slavkap This should only be null if there was a problem creating the 
snapshot on the agent. Maybe look at the agent logs? But I've also tried 
reproducing and could not. In any case I'll add a check to see if the snapshot 
is null and if it is throw an error.



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