winterhazel commented on code in PR #13053:
URL: https://github.com/apache/cloudstack/pull/13053#discussion_r3223364310
##########
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
##########
@@ -1340,6 +1340,15 @@ private void
createManagedVolumeCopyTemplateAsync(VolumeInfo volumeInfo, Primary
primaryDataStore.setDetails(details);
grantAccess(volumeInfo, destHost, primaryDataStore);
+ volumeInfo = volFactory.getVolume(volumeInfo.getId(),
primaryDataStore);
+ // For Netapp ONTAP iscsiName or Lun path is available only after
grantAccess
+ String managedStoreTarget = volumeInfo.get_iScsiName() != null ?
volumeInfo.get_iScsiName() : volumeInfo.getUuid();
+ details.put(PrimaryDataStore.MANAGED_STORE_TARGET,
managedStoreTarget);
+ primaryDataStore.setDetails(details);
Review Comment:
@piyush5netapp I was thinking about modifying `primaryDataStore`'s in-memory
`details` (executing lines 1346-1347) in
`org.apache.cloudstack.storage.driver.OntapPrimaryDatastoreDriver#grantAccess`
inside the `if` between lines 442-445, where `volumeVO.set_iScsiName` is
called. As `grantAccess` updates this information of the volume for the ONTAP
plugin, I think that it makes sense to update the in-memory `details` of
`primaryDataStore` there as well so that it only has
`PrimaryDataStore.MANAGED_STORE_TARGET` for the plugin.
`primaryDataStore` is passed to
`org.apache.cloudstack.storage.driver.OntapPrimaryDatastoreDriver#grantAccess`
as a `DataStore`, so casting it back to `PrimaryDataStore` and calling
`setDetails` there should work.
--
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]