Skip to content

Commit 1e9de6c

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

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
@@ -43,6 +43,7 @@
4343
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
4444
import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService;
4545
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
46+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
4647
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
4748
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
4849
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
@@ -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+
volumeInfo = volFactory.getVolume(volumeInfo.getId(), primaryDataStore);
1347+
// For Netapp ONTAP iscsiName or Lun path is available only after grantAccess
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)