Netapp ONTAP bugfixes for 4.23.0#13578
Open
piyush5netapp wants to merge 3 commits into
Open
Conversation
### Description This PR... <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] 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): <img width="1215" height="117" alt="image" src="https://github.com/user-attachments/assets/0a677980-140d-4904-b196-5a732586a222" /> <img width="1228" height="393" alt="image" src="https://github.com/user-attachments/assets/d5715e87-88d0-4e6e-85e9-2c4b913dfa5f" /> ### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> --------- Co-authored-by: Srivastava, Piyush <Piyush.Srivastava@netapp.com>
#65) ### Description This PR... CSTACKEX-176: Storage Pool Backend by ONTAP FlexVolume is not Thin Provisioned CSTACKEX-172: VM create failure due to aggrs not available and UI says "Unable to orchestrate the start of VM instance" CSTACKEX-199: Error message when cluster password is wrong while creating primary storage pool is not user intuitive CSTACKEX-181: Multiple host with same hostname will not follow per host igroup design ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] 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): <img width="1125" height="861" alt="Screenshot 2026-06-18 at 2 33 52 PM" src="https://github.com/user-attachments/assets/e2f5bc20-0109-4b5a-a720-dbd3d39ee254" /> <img width="679" height="280" alt="image" src="https://github.com/user-attachments/assets/b7dac4f1-1a6b-4234-bcd5-47c5efe8f798" /> ### How Has This Been Tested? 1- Create a storage pool with invalid ontap cred - throw the error 2- Create a storage pool with valid ontap cred - success 3- Verify Ontap Volume - thin provisioned 4- VM instance VM1 creation - suceess and igroup created with cs_svmName_hostUUID 5- VM instance VM2 creation - reused the same igroup 6- VM instance VM1 and VM2 delete - igroup also got deleted #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR delivers targeted NetApp ONTAP (Unified) primary storage bugfixes and related test coverage improvements, addressing correctness issues in iSCSI host access-group naming, connection validation behavior, and attach-time volume metadata consistency.
Changes:
- Reloads the volume from the DB after
grantAccess()during volume attach to avoid using stale managed-storage metadata (e.g., ONTAP-updated path/iSCSI name). - Updates ONTAP iGroup naming to use host UUIDs, sanitize invalid characters, and enforce the ONTAP 96-character limit (with new unit tests).
- Refines ONTAP
connect()validation to focus on connectivity/SVM/aggregate state (not pool-capacity comparisons), adds clearer auth failures, enforces KVM-only attach in the ONTAP datastore lifecycle, and sets thin-provisioning guarantee on FlexVolume create.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java | Reloads volume after grantAccess() during attach to pick up driver-updated fields. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageUtils.java | Switches iGroup naming to host UUID, sanitizes, and truncates to ONTAP limits. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageConstants.java | Adds iGroup max-length constant (96). |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java | Uses host UUID for iGroup naming for create/delete access group paths. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java | Uses host UUID for iGroup naming in grant/revoke access. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java | Adjusts connect() aggregate selection logic, improves auth error handling, and sets FlexVolume guarantee to NONE. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java | Enforces KVM-only attachZone and persists pool hypervisor type before host connections. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Volume.java | Adds JSON model support for guarantee to drive FlexVolume provisioning mode. |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/utils/OntapStorageUtilsTest.java | New tests for iGroup naming (sanitization and max-length enforcement). |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/UnifiedSANStrategyTest.java | Updates host mocks to provide UUIDs for iGroup naming. |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/StorageStrategyTest.java | Adds regression tests for connect() behavior and invalid credentials handling. |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycleTest.java | Expands lifecycle tests, including KVM-only attachZone validation. |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriverTest.java | Updates host mocks to provide UUIDs used by iGroup naming paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5096
to
+5099
| // Reload volume from DB after grantAccess — managed storage drivers (e.g. ONTAP) | ||
| // may update the volume's path and iScsiName during grantAccess, so the local | ||
| // volumeToAttach object can be stale. | ||
| volumeToAttach = _volsDao.findById(volumeToAttach.getId()); |
Comment on lines
+142
to
151
| public static String getIgroupName(String svmName, String hostUuid) { | ||
| //Igroup name format: cs_svmName_hostUuid | ||
| String sanitizedHostUuid = hostUuid.replaceAll("[^a-zA-Z0-9_-]", "_"); | ||
| String igroupName = OntapStorageConstants.CS + OntapStorageConstants.UNDERSCORE + svmName + OntapStorageConstants.UNDERSCORE + sanitizedHostUuid; | ||
| // ONTAP igroup names are limited to 96 characters; truncate if longer. | ||
| if (igroupName.length() > OntapStorageConstants.IGROUP_NAME_MAX_LENGTH) { | ||
| igroupName = igroupName.substring(0, OntapStorageConstants.IGROUP_NAME_MAX_LENGTH); | ||
| } | ||
| return igroupName; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR...
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?