Skip to content

CSTACKEX-191: logical access methods can have return type as primitive#60

Merged
rajiv-jain-netapp merged 4 commits into
mainfrom
feature/CSTACKEX-191
Jun 11, 2026
Merged

CSTACKEX-191: logical access methods can have return type as primitive#60
rajiv-jain-netapp merged 4 commits into
mainfrom
feature/CSTACKEX-191

Conversation

@rajiv-jain-netapp

@rajiv-jain-netapp rajiv-jain-netapp commented May 22, 2026

Copy link
Copy Markdown

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@suryag1201 suryag1201 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please update the testing section after making these changes

@rajiv-jain-netapp

Copy link
Copy Markdown
Author

Testing results: I got my lab and setup working back yesterday. And I just closed the storage-pool and VM create workflow, tested with the changes. All are working fine.

@rajiv-jain-netapp

Copy link
Copy Markdown
Author

Please update the testing section after making these changes

updated testing details

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the ONTAP storage strategy API so logical-access operations return the LUN number as a primitive String rather than a Map, and propagates that signature change through SAN/NAS strategies and tests. It also includes some refactoring/cleanup (logging level changes, method extraction in the ONTAP primary datastore driver, and a small KVM iSCSI wait-time adjustment).

Changes:

  • Change enableLogicalAccess / getLogicalAccess return types from Map<String,String> to String (LUN number) across the ONTAP storage strategy API and implementations.
  • Update SAN strategy behavior to return the LUN number directly and adjust dependent logic accordingly.
  • Refactor ONTAP primary datastore driver access-grant/revoke flows and apply several small logging/formatting tweaks (plus KVM iSCSI wait retry reduction).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/UnifiedSANStrategyTest.java Updates tests for new String return type (needs stronger assertions for expected LUN values).
plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/StorageStrategyTest.java Updates test stub to match new abstract method signatures.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java Returns LUN number as String, adds response validation, adjusts ensure-mapping flow, and changes logging levels.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java Updates method signatures to return String (currently returns null).
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java Updates abstract method signatures to return String (Javadoc needs alignment).
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java Minor formatting cleanup.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeConcise.java Formatting cleanup (annotation spacing, brace placement).
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java Extracts iSCSI grant-access logic; refactors revoke-access validation into helper; adds nullable helper result container.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java Reduces wait retries for disk availability and logs exceptions when filesystem size checks fail.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Map<String, String> response = null;
@Override
public String enableLogicalAccess(Map<String, String> values) {
logger.trace("enableLogicalAccess : Creating LunMap with values {} ", values);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think there was any ask to convert all the logs to 'trace'. Let's use either 'info' or 'debug' itself?

@sandeeplocharla sandeeplocharla left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Except for using trace level logs, rest look fine to me

@rajiv-jain-netapp rajiv-jain-netapp merged commit 446112b into main Jun 11, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants