Skip to content

Commit 4fdda63

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
CSTACKEX-16 Fix Copy Issues
1 parent 1daa6df commit 4fdda63

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,14 @@ public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCm
715715
String accessGroupName = Utility.getIgroupName(poolDetails.get(Constants.SVM_NAME), storagePool.getUuid());
716716

717717
// Map the snapshot's cloned LUN to the igroup
718-
sanStrategy.ensureLunMapped(poolDetails.get(Constants.SVM_NAME), clonedCloudStackVolume.getLun().getName(), accessGroupName);
718+
String lunNumber = sanStrategy.ensureLunMapped(poolDetails.get(Constants.SVM_NAME), clonedCloudStackVolume.getLun().getName(), accessGroupName);
719+
// Store DiskTO.IQN in snapshot_details so StorageSystemDataMotionStrategy.getSnapshotDetails()
720+
// can build the iSCSI source details for the CopyCommand sent to the KVM agent
721+
722+
// Update volume path if changed (e.g., after migration or re-mapping)
723+
String iscsiPath = Constants.SLASH + storagePool.getPath() + Constants.SLASH + lunNumber;
719724
if (ProtocolType.ISCSI.name().equalsIgnoreCase(poolDetails.get(Constants.PROTOCOL))) {
720-
snapshotObjectTo.setPath(clonedCloudStackVolume.getLun().getName());
725+
snapshotObjectTo.setPath(iscsiPath);
721726
snapshotId = clonedCloudStackVolume.getLun().getUuid();
722727
snapshotSize = clonedCloudStackVolume.getLun().getSpace().getSize();
723728
}

0 commit comments

Comments
 (0)