abh1sar commented on code in PR #12549:
URL: https://github.com/apache/cloudstack/pull/12549#discussion_r2744502584


##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -215,7 +215,7 @@ private BackupVO createBackupObject(VirtualMachine vm, 
String backupPath) {
     public boolean restoreVMFromBackup(VirtualMachine vm, Backup backup) {
         List<Backup.VolumeInfo> backedVolumes = backup.getBackedUpVolumes();
         List<VolumeVO> volumes = backedVolumes.stream()
-                .map(volume -> volumeDao.findByUuid(volume.getUuid()))
+                .map(volume -> volumeDao.findByUuid(volume.getPath()))

Review Comment:
   volumeDao.findByUuid() should take volume.getUuid() as an argument not path.
   
   Volume paths are actually set in         
restoreCommand.setVolumePaths(getVolumePaths(volumes));
   which is getting the path from volume.getPath().
   So, ideally it should work as is. Can you check?
   
   The bug is obvious in Restore single volume code      
restoreCommand.setVolumePaths(Collections.singletonList(String.format("%s/%s", 
dataStore.getLocalPath(), volumeUUID)));
    -- here we should use the volume path not uuid
   



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