Skip to content

Commit d287dec

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
feature/CSTACKEX-211: add provider check for copycommand
1 parent 98dd578 commit d287dec

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
4747
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
4848
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
49+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
4950
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
5051
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
5152
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -1341,11 +1342,13 @@ private void createManagedVolumeCopyTemplateAsync(VolumeInfo volumeInfo, Primary
13411342
primaryDataStore.setDetails(details);
13421343

13431344
grantAccess(volumeInfo, destHost, primaryDataStore);
1344-
volumeInfo = volFactory.getVolume(volumeInfo.getId(), primaryDataStore);
1345-
// For Netapp ONTAP iscsiName or Lun path is available only after grantAccess
1346-
String managedStoreTarget = ObjectUtils.defaultIfNull(volumeInfo.get_iScsiName(), volumeInfo.getUuid());
1347-
details.put(PrimaryDataStore.MANAGED_STORE_TARGET, managedStoreTarget);
1348-
primaryDataStore.setDetails(details);
1345+
if (DataStoreProvider.ONTAP_PLUGIN_NAME.equals(primaryDataStore.getStorageProviderName())) {
1346+
// For Netapp ONTAP iscsiName or Lun path is available only after grantAccess
1347+
volumeInfo = volFactory.getVolume(volumeInfo.getId(), primaryDataStore);
1348+
String managedStoreTarget = ObjectUtils.defaultIfNull(volumeInfo.get_iScsiName(), volumeInfo.getUuid());
1349+
details.put(PrimaryDataStore.MANAGED_STORE_TARGET, managedStoreTarget);
1350+
primaryDataStore.setDetails(details);
1351+
}
13491352

13501353
try {
13511354
motionSrv.copyAsync(srcTemplateInfo, destTemplateInfo, destHost, caller);

0 commit comments

Comments
 (0)