-
Notifications
You must be signed in to change notification settings - Fork 0
CSTACKEX-46 Create Async, Attach Cluster/Zone and Grant/Revoke Access #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements asynchronous volume creation, cluster/zone attachment with access group management, and grant/revoke access operations for ONTAP storage integration. The changes introduce iSCSI protocol support with proper LUN mapping and unmapping capabilities.
Key Changes:
- Implemented access group (igroup) creation, retrieval, and management for SAN protocols
- Added logical access control through LUN mapping/unmapping operations
- Enhanced cluster/zone attachment flows with host identifier validation and access group provisioning
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Utility.java | Added utility methods for access group creation, LUN/igroup naming, OS type mapping, and storage strategy initialization |
| Constants.java | Renamed PATH_SEPARATOR to SLASH and added new constants for ONTAP API fields and naming conventions |
| UnifiedSANStrategy.java | Implemented createAccessGroup, getAccessGroup, enableLogicalAccess, and disableLogicalAccess methods for iSCSI LUN operations |
| UnifiedNASStrategy.java | Updated method signatures to match interface changes (public visibility and parameter types) |
| StorageStrategy.java | Modified abstract method signatures to use Map parameters and public visibility for access control operations |
| OntapPrimaryDatastoreLifecycle.java | Enhanced attachCluster and attachZone with protocol validation, host identifier collection, and access group creation |
| SANFeignClient.java | Updated API endpoints with proper ONTAP REST API paths and added QueryMap support for flexible query parameters |
| OntapPrimaryDatastoreDriver.java | Implemented grantAccess and revokeAccess methods with volume-level access control through LUN mapping |
Comments suppressed due to low confidence (2)
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java:1
- Missing space after 'if' keyword. Add space for consistency with Java coding conventions:
if (condition)instead ofif(condition).
/*
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java:1
- Missing space after 'if' keyword. Add space for consistency with Java coding conventions:
if (condition)instead ofif(condition).
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
...ge/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SANFeignClient.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...torage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java
Outdated
Show resolved
Hide resolved
...torage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java:1
- The method
getAccessGroupByNameusesConstants.NAMEas a key, but thegetAccessGroupmethod inUnifiedSANStrategyexpectsConstants.IGROUP_DOT_NAME(line 182). This mismatch will cause the access group retrieval to fail.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...torage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...torage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
| } | ||
|
|
||
| private void grantAccessForVolume(StoragePoolVO storagePool, VolumeVO volumeVO, Host host) { | ||
| Map<String, String> details = storagePoolDetailsDao.listDetailsKeyPairs(storagePool.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retrieving storagepool details is a common requirement, so, these 2 lines of code could be a good candidate for Utility class
| throw new CloudRuntimeException(errMsg); | ||
| } | ||
| } | ||
| private boolean hostInitiatorFoundInIgroup(String hostInitiator, Igroup igroup) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to this, getLunName and getIgroupName methods could've been private methods in this class or we can create a helper class for such operations, instead of putting them in Utility
| switch (protocol) { | ||
| case ISCSI: | ||
| // Access group name format: cs_svmName_scopeId | ||
| String igroupName = Utility.getIgroupName(svmName, scopeId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This getIgroupName could rather be in some helper class instead of Utility
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Outdated
Show resolved
Hide resolved
...torage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 21 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Show resolved
Hide resolved
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java
Outdated
Show resolved
Hide resolved
...age/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
...ap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Outdated
Show resolved
Hide resolved
...me/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Create Async, Attach Cluster/Zone and Grant/Revoke Access
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?