Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest UI changes, users will not have any provision to pass the isDisaggregated flag value, right?

Copy link
Author

@suryag1201 suryag1201 Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, isDisaggregated flag value, user can not pass through with latest UI changes

Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@
public class OntapStorage {
private final String username;
private final String password;
private final String managementLIF;
private final String storageIP;
private final String svmName;
private final Long size;
private final ProtocolType protocolType;
private final Boolean isDisaggregated;

public OntapStorage(String username, String password, String managementLIF, String svmName, Long size, ProtocolType protocolType, Boolean isDisaggregated) {
public OntapStorage(String username, String password, String storageIP, String svmName, Long size, ProtocolType protocolType) {
this.username = username;
this.password = password;
this.managementLIF = managementLIF;
this.storageIP = storageIP;
this.svmName = svmName;
this.size = size;
this.protocolType = protocolType;
this.isDisaggregated = isDisaggregated;
}

public String getUsername() {
Expand All @@ -48,13 +46,9 @@ public String getPassword() {
return password;
}

public String getManagementLIF() {
return managementLIF;
}
public String getStorageIP() { return storageIP; }

public String getSvmName() {
return svmName;
}
public String getSvmName() { return svmName; }

public Long getSize() {
return size;
Expand All @@ -63,8 +57,4 @@ public Long getSize() {
public ProtocolType getProtocol() {
return protocolType;
}

public Boolean getIsDisaggregated() {
return isDisaggregated;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public DataStore initialize(Map<String, Object> dsInfos) {
if (dsInfos == null) {
throw new CloudRuntimeException("Datastore info map is null, cannot create primary storage");
}
String url = (String) dsInfos.get("url");
Long zoneId = (Long) dsInfos.get("zoneId");
Long podId = (Long) dsInfos.get("podId");
Long clusterId = (Long) dsInfos.get("clusterId");
Expand Down Expand Up @@ -152,39 +151,20 @@ public DataStore initialize(Map<String, Object> dsInfos) {
throw new CloudRuntimeException("ONTAP primary storage must be managed");
}

//Required ONTAP detail keys
Set<String> requiredKeys = Set.of(
Constants.USERNAME,
Constants.PASSWORD,
Constants.SVM_NAME,
Constants.PROTOCOL,
Constants.MANAGEMENT_LIF
Constants.STORAGE_IP
);

Set<String> optionalKeys = Set.of(
Constants.IS_DISAGGREGATED
);

Set<String> allowedKeys = new java.util.HashSet<>(requiredKeys);
allowedKeys.addAll(optionalKeys);

// Parse key=value pairs from URL into details (skip empty segments)
if (url != null && !url.isEmpty()) {
for (String segment : url.split(Constants.SEMICOLON)) {
if (segment.isEmpty()) {
continue;
}
String[] kv = segment.split(Constants.EQUALS, 2);
if (kv.length == 2) {
details.put(kv[0].trim(), kv[1].trim());
}
}
}

// Validate existing entries (reject unexpected keys, empty values)
for (Map.Entry<String, String> e : details.entrySet()) {
String key = e.getKey();
String val = e.getValue();
if (!allowedKeys.contains(key)) {
if (!requiredKeys.contains(key)) {
throw new CloudRuntimeException("Unexpected ONTAP detail key in URL: " + key);
}
if (val == null || val.isEmpty()) {
Expand All @@ -202,21 +182,17 @@ public DataStore initialize(Map<String, Object> dsInfos) {

details.put(Constants.SIZE, capacityBytes.toString());

// Default for IS_DISAGGREGATED if needed
details.putIfAbsent(Constants.IS_DISAGGREGATED, "false");

ProtocolType protocol = ProtocolType.valueOf(details.get(Constants.PROTOCOL));

// Connect to ONTAP and create volume
long volumeSize = Long.parseLong(details.get(Constants.SIZE));
OntapStorage ontapStorage = new OntapStorage(
details.get(Constants.USERNAME),
details.get(Constants.PASSWORD),
details.get(Constants.MANAGEMENT_LIF),
details.get(Constants.STORAGE_IP),
details.get(Constants.SVM_NAME),
volumeSize,
protocol,
Boolean.parseBoolean(details.get(Constants.IS_DISAGGREGATED).toLowerCase()));
protocol);

StorageStrategy storageStrategy = StorageProviderFactory.getStrategy(ontapStorage);
boolean isValid = storageStrategy.connect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,15 @@ public static StorageStrategy getStrategy(OntapStorage ontapStorage) {
s_logger.info("Initializing StorageProviderFactory with protocol: " + protocol);
switch (protocol) {
case NFS3:
if (!ontapStorage.getIsDisaggregated()) {
UnifiedNASStrategy unifiedNASStrategy = new UnifiedNASStrategy(ontapStorage);
ComponentContext.inject(unifiedNASStrategy);
unifiedNASStrategy.setOntapStorage(ontapStorage);
return unifiedNASStrategy;
}
throw new CloudRuntimeException("Unsupported configuration: Disaggregated ONTAP is not supported.");
UnifiedNASStrategy unifiedNASStrategy = new UnifiedNASStrategy(ontapStorage);
ComponentContext.inject(unifiedNASStrategy);
unifiedNASStrategy.setOntapStorage(ontapStorage);
return unifiedNASStrategy;
case ISCSI:
if (!ontapStorage.getIsDisaggregated()) {
UnifiedSANStrategy unifiedSANStrategy = new UnifiedSANStrategy(ontapStorage);
ComponentContext.inject(unifiedSANStrategy);
unifiedSANStrategy.setOntapStorage(ontapStorage);
return unifiedSANStrategy;
}
throw new CloudRuntimeException("Unsupported configuration: Disaggregated ONTAP is not supported.");
UnifiedSANStrategy unifiedSANStrategy = new UnifiedSANStrategy(ontapStorage);
ComponentContext.inject(unifiedSANStrategy);
unifiedSANStrategy.setOntapStorage(ontapStorage);
return unifiedSANStrategy;
default:
throw new CloudRuntimeException("Unsupported protocol: " + protocol);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public abstract class StorageStrategy {

public StorageStrategy(OntapStorage ontapStorage) {
storage = ontapStorage;
String baseURL = Constants.HTTPS + storage.getManagementLIF();
String baseURL = Constants.HTTPS + storage.getStorageIP();
s_logger.info("Initializing StorageStrategy with base URL: " + baseURL);
// Initialize FeignClientFactory and create clients
this.feignClientFactory = new FeignClientFactory();
Expand All @@ -93,7 +93,7 @@ public StorageStrategy(OntapStorage ontapStorage) {

// Connect method to validate ONTAP cluster, credentials, protocol, and SVM
public boolean connect() {
s_logger.info("Attempting to connect to ONTAP cluster at " + storage.getManagementLIF() + " and validate SVM " +
s_logger.info("Attempting to connect to ONTAP cluster at " + storage.getStorageIP() + " and validate SVM " +
storage.getSvmName() + ", protocol " + storage.getProtocol());
//Get AuthHeader
String authHeader = Utility.generateAuthHeader(storage.getUsername(), storage.getPassword());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class UnifiedNASStrategy extends NASStrategy {

public UnifiedNASStrategy(OntapStorage ontapStorage) {
super(ontapStorage);
String baseURL = Constants.HTTPS + ontapStorage.getManagementLIF();
String baseURL = Constants.HTTPS + ontapStorage.getStorageIP();
this.feignClientFactory = new FeignClientFactory();
this.nasFeignClient = feignClientFactory.createClient(NASFeignClient.class, baseURL);
this.volumeFeignClient = feignClientFactory.createClient(VolumeFeignClient.class,baseURL );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class UnifiedSANStrategy extends SANStrategy {

public UnifiedSANStrategy(OntapStorage ontapStorage) {
super(ontapStorage);
String baseURL = Constants.HTTPS + ontapStorage.getManagementLIF();
String baseURL = Constants.HTTPS + ontapStorage.getStorageIP();
// Initialize FeignClientFactory and create SAN client
this.feignClientFactory = new FeignClientFactory();
this.sanFeignClient = feignClientFactory.createClient(SANFeignClient.class, baseURL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class Constants {

public static final String ONTAP_PLUGIN_NAME = "ONTAP";
public static final String ONTAP_PLUGIN_NAME = "NetApp ONTAP";
public static final int NFS3_PORT = 2049;
public static final int ISCSI_PORT = 3260;

Expand All @@ -34,7 +34,7 @@ public class Constants {
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String DATA_LIF = "dataLIF";
public static final String MANAGEMENT_LIF = "managementLIF";
public static final String STORAGE_IP = "storageIP";
public static final String VOLUME_NAME = "volumeName";
public static final String VOLUME_UUID = "volumeUUID";
public static final String EXPORT_POLICY_ID = "exportPolicyId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ public static StorageStrategy getStrategyByStoragePoolDetails(Map<String, String
}
String protocol = details.get(Constants.PROTOCOL);
OntapStorage ontapStorage = new OntapStorage(details.get(Constants.USERNAME), details.get(Constants.PASSWORD),
details.get(Constants.MANAGEMENT_LIF), details.get(Constants.SVM_NAME), Long.parseLong(details.get(Constants.SIZE)),
ProtocolType.valueOf(protocol),
Boolean.parseBoolean(details.get(Constants.IS_DISAGGREGATED)));
details.get(Constants.STORAGE_IP), details.get(Constants.SVM_NAME), Long.parseLong(details.get(Constants.SIZE)),
ProtocolType.valueOf(protocol));
StorageStrategy storageStrategy = StorageProviderFactory.getStrategy(ontapStorage);
boolean isValid = storageStrategy.connect();
if (isValid) {
Expand Down
Loading
Loading