Skip to content

Feature/cstackex 213: Upstream PR 13578 comments resolution#78

Merged
piyush5netapp merged 4 commits into
mainfrom
feature/CSTACKEX-213
Jul 10, 2026
Merged

Feature/cstackex 213: Upstream PR 13578 comments resolution#78
piyush5netapp merged 4 commits into
mainfrom
feature/CSTACKEX-213

Conversation

@piyush5netapp

@piyush5netapp piyush5netapp commented Jul 10, 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):

Storage pool
image
VM instance
image
ONTAP flexvol
image
ONTAP Luns
image
ONTAP Igroup
image

How Has This Been Tested?

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

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 ONTAP primary storage attach-zone behavior to use the PrimaryDataStoreHelper.attachZone(DataStore, HypervisorType) overload (rather than updating the pool directly), adjusts ONTAP unit tests accordingly, and changes volume-attach behavior around reloading VolumeVO after grantAccess.

Changes:

  • Update ONTAP primary datastore lifecycle to call _dataStoreHelper.attachZone(dataStore, hypervisorType) and remove direct storagePoolDao.update(...) for hypervisor persistence.
  • Update ONTAP lifecycle unit tests to stub/verify the new attachZone(DataStore, HypervisorType) helper call.
  • Modify VolumeApiServiceImpl to reload the volume from DB after grantAccess only when the storage provider is ONTAP.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java Alters post-grantAccess volume reload logic during attach.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java Switches zone attach to use helper overload that sets hypervisor/scope.
plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycleTest.java Updates mocks/verifications for the helper overload and adjusts assertions.

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

Comment thread server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
Comment on lines 852 to +853
assertTrue(result, "attachZone should succeed for KVM hypervisor");
verify(storagePoolDao, times(1)).update(eq(1L), any(StoragePoolVO.class));
verify(_dataStoreHelper, times(1)).attachZone(any(DataStore.class), eq(Hypervisor.HypervisorType.KVM));
Copilot AI review requested due to automatic review settings July 10, 2026 11:15

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +4855 to +4857
if(DataStoreProvider.ONTAP_PLUGIN_NAME.equals(volumeToAttachStoragePool.getStorageProviderName())){
volumeToAttach = _volsDao.findById(volumeToAttach.getId());
}
Comment on lines 850 to +853
dataStore, zoneScope, Hypervisor.HypervisorType.KVM);

assertTrue(result, "attachZone should succeed for KVM hypervisor");
verify(storagePoolDao, times(1)).update(eq(1L), any(StoragePoolVO.class));
verify(_dataStoreHelper, times(1)).attachZone(any(DataStore.class), eq(Hypervisor.HypervisorType.KVM));
@piyush5netapp piyush5netapp merged commit a59b49e into main Jul 10, 2026
20 checks passed
piyush5netapp added a commit that referenced this pull request Jul 10, 2026
### 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)
- [ ] 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):
Storage pool
<img width="1240" height="439" alt="image"
src="https://github.com/user-attachments/assets/cfc7bfdc-9807-470c-b043-ff1905acd0d0"
/>
VM instance
<img width="1230" height="353" alt="image"
src="https://github.com/user-attachments/assets/e8bf157d-105a-4c85-8452-9c391c467778"
/>
ONTAP flexvol
<img width="1261" height="241" alt="image"
src="https://github.com/user-attachments/assets/f7159199-a26a-4147-a41f-44524fe7ca8e"
/>
ONTAP Luns
<img width="1267" height="207" alt="image"
src="https://github.com/user-attachments/assets/a3645d25-d7b3-412c-bed7-2c43d6a0e6b8"
/>
ONTAP Igroup
<img width="1254" height="630" alt="image"
src="https://github.com/user-attachments/assets/1af9953a-d761-4b53-884d-e7c9f7ba8b6f"
/>


### 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>
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.

3 participants