Skip to content

Netapp ONTAP bugfixes for 4.23.0#13578

Open
piyush5netapp wants to merge 3 commits into
apache:mainfrom
NetApp:NetappOntapbugfixes4.23.0
Open

Netapp ONTAP bugfixes for 4.23.0#13578
piyush5netapp wants to merge 3 commits into
apache:mainfrom
NetApp:NetappOntapbugfixes4.23.0

Conversation

@piyush5netapp

@piyush5netapp piyush5netapp commented Jul 9, 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?

piyush5netapp and others added 3 commits July 9, 2026 21:29
### 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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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;
}
@winterhazel winterhazel added this to the 4.23.0 milestone Jul 9, 2026
@winterhazel winterhazel self-requested a review July 9, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants