Pearl1594 commented on code in PR #12549:
URL: https://github.com/apache/cloudstack/pull/12549#discussion_r2772548764
##########
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:
With respect to this statement:
> Now in the context of this PR, we should get the path from
volume.getPath() not from backup-up volumes metadata.
I think we need to consider backedVolume.getPath() - as a volume could have
gotten migrated and the path changes. But when restoring from a backup, we need
to reference the path of the backedVolume (which was the path of the volume
prior to the migrate operation). Correct me if I'm wrong.
If volumeUuid is passed, then volume's uuid is used, but, when null, it uses
the backupVolume path to determine the backup file as seen in :
https://github.com/apache/cloudstack/blob/main/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java#L224-L225
--
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]