Skip to content

Commit 74e6584

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
pull latest main 2
1 parent ef728cd commit 74e6584

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

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

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
4545
import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
4646
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
47-
import org.apache.cloudstack.storage.feign.model.OntapStorage;
48-
import org.apache.cloudstack.storage.provider.StorageProviderFactory;
4947
import org.apache.cloudstack.storage.service.StorageStrategy;
5048
import org.apache.cloudstack.storage.service.model.CloudStackVolume;
5149
import org.apache.cloudstack.storage.service.model.ProtocolType;
@@ -131,7 +129,7 @@ private String createCloudStackVolumeForTypeVolume(DataStore dataStore, VolumeIn
131129
throw new CloudRuntimeException("createCloudStackVolume : Storage Pool not found for id: " + dataStore.getId());
132130
}
133131
Map<String, String> details = storagePoolDetailsDao.listDetailsKeyPairs(dataStore.getId());
134-
StorageStrategy storageStrategy = getStrategyByStoragePoolDetails(details);
132+
StorageStrategy storageStrategy = Utility.getStrategyByStoragePoolDetails(details);
135133
s_logger.info("createCloudStackVolumeForTypeVolume: Connection to Ontap SVM [{}] successful, preparing CloudStackVolumeRequest", details.get(Constants.SVM_NAME));
136134
CloudStackVolume cloudStackVolumeRequest = Utility.createCloudStackVolumeRequestByProtocol(storagePool, details, volumeObject);
137135
CloudStackVolume cloudStackVolume = storageStrategy.createCloudStackVolume(cloudStackVolumeRequest);
@@ -295,24 +293,4 @@ public boolean isStorageSupportHA(Storage.StoragePoolType type) {
295293
public void detachVolumeFromAllStorageNodes(Volume volume) {
296294

297295
}
298-
299-
private StorageStrategy getStrategyByStoragePoolDetails(Map<String, String> details) {
300-
if (details == null || details.isEmpty()) {
301-
s_logger.error("getStrategyByStoragePoolDetails: Storage pool details are null or empty");
302-
throw new CloudRuntimeException("getStrategyByStoragePoolDetails: Storage pool details are null or empty");
303-
}
304-
String protocol = details.get(Constants.PROTOCOL);
305-
OntapStorage ontapStorage = new OntapStorage(details.get(Constants.USERNAME), details.get(Constants.PASSWORD),
306-
details.get(Constants.MANAGEMENT_LIF), details.get(Constants.SVM_NAME), Long.parseLong(details.get(Constants.SIZE)), ProtocolType.valueOf(protocol),
307-
Boolean.parseBoolean(details.get(Constants.IS_DISAGGREGATED)));
308-
StorageStrategy storageStrategy = StorageProviderFactory.getStrategy(ontapStorage);
309-
boolean isValid = storageStrategy.connect();
310-
if (isValid) {
311-
s_logger.info("Connection to Ontap SVM [{}] successful", details.get(Constants.SVM_NAME));
312-
return storageStrategy;
313-
} else {
314-
s_logger.error("getStrategyByStoragePoolDetails: Connection to Ontap SVM [" + details.get(Constants.SVM_NAME) + "] failed");
315-
throw new CloudRuntimeException("getStrategyByStoragePoolDetails: Connection to Ontap SVM [" + details.get(Constants.SVM_NAME) + "] failed");
316-
}
317-
}
318296
}

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/provider/StorageProviderFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static StorageStrategy getStrategy(OntapStorage ontapStorage) {
3737
ProtocolType protocol = ontapStorage.getProtocol();
3838
s_logger.info("Initializing StorageProviderFactory with protocol: " + protocol);
3939
switch (protocol) {
40-
case NFS:
40+
case NFS3:
4141
if (!ontapStorage.getIsDisaggregated()) {
4242
UnifiedNASStrategy unifiedNASStrategy = new UnifiedNASStrategy(ontapStorage);
4343
ComponentContext.inject(unifiedNASStrategy);

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Constants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public class Constants {
3535
public static final String VOLUME_UUID = "volumeUUID";
3636
public static final String IS_DISAGGREGATED = "isDisaggregated";
3737
public static final String RUNNING = "running";
38-
public static final String VOLUME_UUID = "volumeUUID";
39-
public static final String VOLUME_NAME = "volumeNAME";
4038
public static final String EXPORT = "export";
4139

4240
public static final int ONTAP_PORT = 443;

0 commit comments

Comments
 (0)