piyush5netapp commented on PR #13053:
URL: https://github.com/apache/cloudstack/pull/13053#issuecomment-4886348787

   > > @winterhazel I tried this but instance creation failed . This is because 
Netapp ONTAP updates/set iScsiName in grantAccess, so we need to refresh the 
volumeInfo object again to take latest data here. Its currently taking old 
data. Does Moving grantAcess above line "ManagedCreateBaseImageContext context 
= new ManagedCreateBaseImageContext<>(null, volumeInfo, primaryDataStore, 
srcTemplateInfo, future);" will have any side-effect for any vendor ?
   > 
   > @piyush5netapp I missed this crucial detail :(
   > 
   > Moving `grantAcess` to above `ManagedCreateBaseImageContext context = new 
ManagedCreateBaseImageContext<>(null, volumeInfo, primaryDataStore, 
srcTemplateInfo, future);` should not have any side effects, but we will still 
need to refresh the `volumeInfo` again anyways to get the updated `iScsiName`.
   > 
   > I think we can leave this code the way it is organized now then. I would 
just add a check to perform this extra refresh only if the ONTAP plugin is 
being used, like:
   > 
   > ```java
   > ...
   > grantAccess(volumeInfo, destHost, primaryDataStore);
   > 
   > if 
(DataStoreProvider.ONTAP_PLUGIN_NAME.equals(primaryDataStore.getStorageProviderName()))
 {
   >     // For Netapp ONTAP iscsiName or Lun path  is available only after 
grantAccess
   >     volumeInfo = volFactory.getVolume(volumeInfo.getId(), 
primaryDataStore);
   >     String managedStoreTarget = 
ObjectUtils.defaultIfNull(volumeInfo.get_iScsiName(), volumeInfo.getUuid());
   >     details.put(PrimaryDataStore.MANAGED_STORE_TARGET, managedStoreTarget);
   >     primaryDataStore.setDetails(details);
   > }
   > 
   > try {
   >     motionSrv.copyAsync(srcTemplateInfo, destTemplateInfo, destHost, 
caller);
   > ...
   > ```
   > 
   > > @weizhouapache @winterhazel , good to merge?
   > 
   > @DaanHoogland I think so. Let's just wait for @piyush5netapp to check the 
suggestion above.
   
   @winterhazel  I think the plugin check will work . I will do the change in 
subsequent PR. Let's not hold this PR for this suggestion to test as its not a 
critical concern. 


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