Skip to content

Multi-Host support for NFS3 and iSCSI - #64

Merged
sandeeplocharla merged 10 commits into
mainfrom
feature/CSTACKEX-192
Jul 29, 2026
Merged

Multi-Host support for NFS3 and iSCSI#64
sandeeplocharla merged 10 commits into
mainfrom
feature/CSTACKEX-192

Conversation

@sandeeplocharla

@sandeeplocharlasandeeplocharla commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR...
Provides support to Multi-Host for NFS3 and iSCSI

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?

Only 1 Host present in the Cluster
Screenshot 2026-07-14 at 9 19 49 AM

Created an NFS3 StoragePool with Cluster scope
Screenshot 2026-07-14 at 9 20 58 AM

ONTAP volume created for the SP
Screenshot 2026-07-14 at 9 21 30 AM

Export Policy rule and client
Screenshot 2026-07-14 at 9 34 00 AM

Added a new host
Screenshot 2026-07-14 at 9 24 42 AM

Updated client in the Export Policy
Screenshot 2026-07-14 at 9 35 24 AM

Removed the host from the cluster
Screenshot 2026-07-14 at 9 32 16 AM

The respective client has been removed from the Export Policy
Screenshot 2026-07-14 at 9 36 07 AM

Test DoneResultComments
Create an instance by specifying the host and disk offering pointed to NFS3 Primary Storage Pool (Cluster scoped with min of 2 hosts)PASS
Create an instance specifying host and disk offering pointed to iSCSI Primary Storage Pool (Cluster scoped with min of 2 hosts)PASS
Create an instance in a cluster with atleast 2 hosts in the cluster by not specifying the host and disk offering pointed to NFS3 Primary Storage Pool (Cluster scoped with min of 2 hosts)PASS
Create an instance in a cluster with atleast 2 hosts in the cluster by not specifying the host and disk offering pointed to iSCSI Primary Storage Pool (Cluster scoped with min of 2 hosts)PASS
Create an instance by specifying the host and disk offering pointed to 2 NFS3 Primary Storage Pools (Cluster scoped + Zone scoped)FAILStoragePoolAllocator is coming as empty and the random strategy to allocate was failing.
Create an instance by specifying the host and disk offering pointed to 2 iSCSI Primary Storage Pools (Cluster scoped + Zone scoped)FAILStoragePoolAllocator is coming as empty and the random strategy to allocate was failing.
Create an instance by specifying the host and disk offering pointed to NFS3 Primary Storage Pool (Zone scoped with min of 2 hosts)FAILZone scoped instance creation failing (CSTACKEX-188)
Create an instance specifying host and disk offering pointed to iSCSI Primary Storage Pool (Zone scoped with min of 2 hosts)FAILZone scoped instance creation failing (CSTACKEX-188)
Create an instance in a cluster with atleast 2 hosts in the cluster by not specifying the host and disk offering pointed to NFS3 Primary Storage Pool (Zone scoped with min of 2 hosts)FAILZone scoped instance creation failing (CSTACKEX-188)
Create an instance in a cluster with atleast 2 hosts in the cluster by not specifying the host and disk offering pointed to iSCSI Primary Storage Pool (Zone scoped with min of 2 hosts)FAILZone scoped instance creation failing (CSTACKEX-188)
Power off VM on Host-1 and start it on Host-2 (same cluster) with disk offering pointed to NFS3 primary storage pool (cluster scoped)PASS
Power off and on a VM with 'last known host' selected. Create the instance in a cluster, without specifying a host.PASSLast known host was selected
Power off and on a VM with 'last known host' NOT selected. Create the instance in a cluster, without specifying a host.PASSVM got hosted on the chosen host.
Power off and on a VM with 'last known host' selected but choose a different host. Create the instance in a cluster, without specifying a host.PASSVM got hosted on the chosen host.
Insufficient resources in the storage pool. Instance creation should fail.PASSGeneric error is being displayed instead of proper error regarding Insufficient resources.
One host in the cluster (min. 2 hosts) loaded, resulting in insufficient CPU. Disk Offering pointed to Cluster scoped primary storage pool.PASS
Both host in the cluster (min. 2 hosts) loaded, resulting in insufficient CPU. Disk Offering pointed to Cluster scoped primary storage pool. Instance creation should fail but disks should first get created and then destroyed.

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

CopilotAI review requested due to automatic review settings July 8, 2026 05:33

CopilotAI 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

Adds multi-host lifecycle handling for the ONTAP volume plugin by updating NFS export policy rules as hosts connect to / are removed from storage pools, and by extending the AccessGroup model/strategy API to support add/remove semantics.

Changes:

  • Implemented UnifiedNASStrategy.updateAccessGroup to add/remove host client matches in an existing NFS export policy.
  • Added HostRuleAction to AccessGroup and wired host-connect / host-removal flows to update NFS3 export policy rules.
  • Tightened/adjusted model and API surface (e.g., StorageStrategy.updateAccessGroup visibility; ExportRule.ProtocolsEnum JSON annotations).

Reviewed changes

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

Show a summary per file
FileDescription
plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/StorageStrategyTest.javaUpdates test scaffolding to match new abstract method visibility; import/method formatting adjustments.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.javaImplements export-policy mutation logic for NFS host add/remove (multi-host enablement).
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.javaMakes updateAccessGroup explicitly public abstract for consistent overriding/call sites.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/model/AccessGroup.javaAdds HostRuleAction (ADD/REMOVE) to drive update semantics.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/listener/OntapHostListener.javaUpdates host lifecycle handling to update NFS3 export policy rules on connect and before removal.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ExportRule.javaAdjusts enum JSON serialization/deserialization behavior for export rule protocols.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.javaImport reordering / formatting-only change.

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

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

CopilotAI review requested due to automatic review settings July 10, 2026 06:13

CopilotAI 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 17 out of 17 changed files in this pull request and generated 4 comments.

CopilotAI review requested due to automatic review settings July 10, 2026 06:40
CopilotAI review requested due to automatic review settings July 13, 2026 10:06

CopilotAI 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 7 out of 7 changed files in this pull request and generated 1 comment.

CopilotAI review requested due to automatic review settings July 13, 2026 10:09

CopilotAI 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 7 out of 7 changed files in this pull request and generated 2 comments.

}

@Override
public boolean hostAboutToBeRemoved(long hostId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thinking aloud, do we not have any usecase where this method returns false?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

If export policy rule hasn't been removed, we could catch the exception and return false

CopilotAI review requested due to automatic review settings July 13, 2026 16:57

CopilotAI 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 7 out of 7 changed files in this pull request and generated 3 comments.

CopilotAI review requested due to automatic review settings July 14, 2026 02:59

CopilotAI 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 7 out of 7 changed files in this pull request and generated 3 comments.

@rajiv-jain-netapprajiv-jain-netapp 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.

In the testing section, I need results for

  1. User created an NFS pool for cluster scope; validate the export policy on the ONTAP for the rules and client added.
  2. Now add a new host to this cluster and validate whether the export policy is getting updated for this new host or not.
  3. Similar to #2, test for host removal as well.

Note: I noticed the term "Live migrate" in your current test case capture. Just to remind you, we do not support live migration yet; these details will lead to a wrong interpretation in audiences. Please correct them accordingly.

@sandeeplocharla

Copy link
Copy Markdown
CollaboratorAuthor

In the testing section, I need results for

  1. User created an NFS pool for cluster scope; validate the export policy on the ONTAP for the rules and client added.
  2. Now add a new host to this cluster and validate whether the export policy is getting updated for this new host or not.
  3. Similar to Feignconfiguration and volume feignClient along with desired POJOs #2, test for host removal as well.

Note: I noticed the term "Live migrate" in your current test case capture. Just to remind you, we do not support live migration yet; these details will lead to a wrong interpretation in audiences. Please correct them accordingly.

Updated the Testing done with the relevant screenshots.
Also, the test section mentions "Live migrate a VM between two hosts in the same cluster". As per my understanding, we currently don't support VM's storage migration i.e., between 2 storage pools, which the test case is not claiming to be. If the language could be made better, please suggest an alternative, will update it accordingly.

@suryag1201suryag1201 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 address the comments

@sandeeplocharla
sandeeplocharla merged commit ba69b74 into mainJul 29, 2026
20 checks passed
rajiv-jain-netapp added a commit that referenced this pull request Jul 29, 2026
Bring in CSTACKEX-158 (idempotent ONTAP snapshot delete) and
multi-host NFS/iSCSI support (#64) on top of the apache/main sync.
@rajiv-jain-netapprajiv-jain-netapp mentioned this pull request Jul 30, 2026
14 tasks
Sign up for freeto 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.

5 participants

@sandeeplocharla@piyush5netapp@rajiv-jain-netapp@suryag1201