Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;

import java.net.URI;
import java.util.Map;

@FeignClient(name = "SvmClient", url = "https://{clusterIP}/api/svm/svms", configuration = FeignConfiguration.class)
public interface SvmFeignClient {
Expand All @@ -41,4 +40,7 @@ public interface SvmFeignClient {
@RequestMapping(method = RequestMethod.GET, value = "/{uuid}")
Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header);

@RequestMapping(method = RequestMethod.PATCH)
Copy link
Author

Choose a reason for hiding this comment

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

We can remove this as not required now.

void updateSVM(URI baseURL, @RequestHeader("Authorization") String header, @RequestBody Svm svm);

}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class OntapPrimaryDatastoreLifecycle extends BasePrimaryDataStoreLifeCycl
*/
@Override
public DataStore initialize(Map<String, Object> dsInfos) {
s_logger.info("initialize {}", dsInfos);
Copy link
Author

Choose a reason for hiding this comment

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

make it debug and make it meaningful.

if (dsInfos == null) {
throw new CloudRuntimeException("Datastore info map is null, cannot create primary storage");
}
Copy link
Author

Choose a reason for hiding this comment

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

Put the sample URL on which below code has been written.

Expand Down Expand Up @@ -149,7 +150,9 @@ public DataStore initialize(Map<String, Object> dsInfos) {
} else {
throw new CloudRuntimeException("ONTAP details validation failed, cannot create primary storage");
}
String storagePath = url + ":/" + storagePoolName;
Copy link
Author

Choose a reason for hiding this comment

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

Put the comment for assuming it is for NFS and URL value.


parameters.setPath(storagePath);
parameters.setTags(tags);
parameters.setIsTagARule(isTagARule);
parameters.setDetails(details);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,29 @@
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

@Component
public class StorageProviderFactory {
private final StorageStrategy storageStrategy;
private static final Logger s_logger = (Logger) LogManager.getLogger(StorageProviderFactory.class);

private StorageProviderFactory(OntapStorage ontapStorage) {
private StorageProviderFactory() {}

public static StorageStrategy getStrategy(OntapStorage ontapStorage) {
ProtocolType protocol = ontapStorage.getProtocol();
s_logger.info("Initializing StorageProviderFactory with protocol: " + protocol);
s_logger.info("Initializing StorageProviderFactory with protocol: {}", protocol);
switch (protocol) {
case NFS:
if(!ontapStorage.getIsDisaggregated()) {
this.storageStrategy = new UnifiedNASStrategy(ontapStorage);
return new UnifiedNASStrategy(ontapStorage);
} else {
throw new CloudRuntimeException("Unsupported configuration: Disaggregated ONTAP is not supported.");
}
break;
case ISCSI:
if (!ontapStorage.getIsDisaggregated()) {
this.storageStrategy = new UnifiedSANStrategy(ontapStorage);
return new UnifiedSANStrategy(ontapStorage);
} else {
throw new CloudRuntimeException("Unsupported configuration: Disaggregated ONTAP is not supported.");
}
break;
default:
this.storageStrategy = null;
throw new CloudRuntimeException("Unsupported protocol: " + protocol);
throw new CloudRuntimeException("Unsupported configuration: " + protocol);
}
}

public static StorageStrategy getStrategy(OntapStorage ontapStorage) {
return new StorageProviderFactory(ontapStorage).storageStrategy;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public NASStrategy(OntapStorage ontapStorage) {
}

public abstract String createExportPolicy(String svmName, String policyName);
Copy link
Author

Choose a reason for hiding this comment

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

Return the policy object

public abstract boolean deleteExportPolicy(String svmName, String policyName);
Copy link
Author

Choose a reason for hiding this comment

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

make it void to pass back the exact error incase of failure

public abstract boolean exportPolicyExists(String svmName, String policyName);
Copy link
Author

Choose a reason for hiding this comment

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

We can have getExportPolicy method

public abstract String addExportRule(String policyName, String clientMatch, String[] protocols, String[] roRule, String[] rwRule);
public abstract String assignExportPolicyToVolume(String volumeUuid, String policyName);
public abstract String enableNFS(String svmUuid);
Copy link
Author

Choose a reason for hiding this comment

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

We don't need this method, SVM should be pre-configured with NFS enabled.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class StorageStrategy {
@Inject
private JobFeignClient jobFeignClient;

private final OntapStorage storage;
protected final OntapStorage storage;

private List<Aggregate> aggregates;

Expand Down
Loading
Loading