Skip to content

CloudStack Volume support with ONTAP storage#13053

Open
rajiv-jain-netapp wants to merge 99 commits into
apache:mainfrom
NetApp:sync/apache-main-apr-2026
Open

CloudStack Volume support with ONTAP storage#13053
rajiv-jain-netapp wants to merge 99 commits into
apache:mainfrom
NetApp:sync/apache-main-apr-2026

Conversation

@rajiv-jain-netapp
Copy link
Copy Markdown

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

Description

Co-authored-by: Sandeep Locharla sandeep.locharla@netapp.com
Co-authored-by: Piyush Srivastava piyush5@netapp.com
Co-authored-by: Surya Gupta suryag@netapp.com

This PR...

  1. Supports cloudstack-volume usecases support for NFS3 and iSCSI protocols.
  2. Support for cloudStack-volume create/delete/attach/detach/snapshot-create.
  3. Instance create/delete/snapshot-create support
  4. Snapshot-create would not support
    1. memory snapshot
    2. user input for quicing option during snapshot creation

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?

Testing Done:

  1. VM create
Screenshot 2026-04-21 at 8 23 41 PM
  1. Validate the respective CloudStack volume
Screenshot 2026-04-21 at 8 24 08 PM
  1. Storage view for the cloudStack volumes
Screenshot 2026-04-21 at 8 32 03 PM
  1. VM snapshot support
Screenshot 2026-04-21 at 8 34 48 PM
  1. Storage view, post snapshot create
Screenshot 2026-04-21 at 8 35 16 PM
  1. CloudStack UI list view for snapshot
Screenshot 2026-04-21 at 8 35 47 PM
  1. CloudStack volume snapshot support
Screenshot 2026-04-21 at 8 36 34 PM
  1. Storage view, post snapshot create
Screenshot 2026-04-21 at 8 37 09 PM
  1. CloudStack UI list view for snapshot
Screenshot 2026-04-21 at 8 43 32 PM

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

Jain, Rajiv and others added 30 commits October 3, 2025 14:02
… added EOF fixes + correcting license header
Initial primary storage pool plugin skeleton
Feignconfiguration and volume feignClient along with desired POJOs with cstack 28
* CSTACKEX-29 Cluster, SVM and Aggr Feign Client

* CSTACKEX-29 Change the endpoint method name in feign client

* CSTACKEX-29 Make the alignment proper

* CSTACKEX-29 Added License Info

* CSTACKEX-29 Resolve Review Comments

* CSTACKEX-29 Remove Component Annotation from datastoredriverclass

* CSTACKEX-29 Resolve Style check issues

* CSTACKEX-29 Resolve ALL Style issues

* CSTACKEX-29 Resolve Precommits Issues

* CSTACKEX-29 Added Method comments and change the ontap response class name

---------

Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-31 NAS and Job Feign Client and POJOs

* CSTACKEX-31 Fixed Checks Issues

* CSTACKEX-31 Resolve Review Comments

* CSTACKEX-31 Resolve Review Comments

* CSTACKEX-31 Resolve Review Comments

* CSTACKEX-31 Added Aggr and size to volume model

* CSTACKEX-31 Change the export policy endpoint path

* CSTACKEX-31 Fixed check styles

---------

Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-30 SAN Feign Client

* CSTACKEX-30 Fixed check style issues

* CSTACKEX-30 Fixed review comments

---------

Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-7: ONTAP Primary storage pool

---------

Co-authored-by: Locharla, Sandeep <Sandeep.Locharla@netapp.com>
CSTACKEX-34: Upgrade to framework classes design
* CSTACKEX-35 Create Async

* CSTACKEX-35 Added Null and empty check

* CSTACKEX-35 Resolved review comments

* CSTACKEX-35 Removed Type Casting for logger

---------

Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-1: Feign changes and fixes for getting storage pool creation to work

* CSTACKEX-01: Create Primary Storage pool changes with working code

* CSTACKEX-01: Addressed all review comments and updated some code

* CSTACKEX-01: Made some changes to fix some errors seen during testing

* CSTACKEX-01: Addressed additional comments

---------

Co-authored-by: Locharla, Sandeep <Sandeep.Locharla@netapp.com>
@rajiv-jain-netapp
Copy link
Copy Markdown
Author

@DaanHoogland @winterhazel , How can we re-trigger the build?

@winterhazel
Copy link
Copy Markdown
Member

winterhazel commented Apr 27, 2026

@DaanHoogland @winterhazel , How can we re-trigger the build?

@rajiv-jain-netapp you can ping @blueorangutan and use the package command, like this:

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17610

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-15969)

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-15974)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56045 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13053-t15974-kvm-ol8.zip
Smoke tests completed. 151 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
Copy link
Copy Markdown
Contributor

@weizhouapache @winterhazel , at your discretion (ready for merge for my part)

Copy link
Copy Markdown
Member

@winterhazel winterhazel left a comment

Choose a reason for hiding this comment

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

Currently reviewing. This will take some time, so I am submitting the reviews partially.

Comment thread .github/workflows/daily-repo-status.lock.yml
Comment thread .github/workflows/daily-repo-status.md

private static final List<Storage.StoragePoolType> supportedStoragePoolTypes = List.of(Storage.StoragePoolType.Filesystem, Storage.StoragePoolType.NetworkFilesystem, Storage.StoragePoolType.SharedMountPoint);

private static final String ONTAP_PROVIDER_NAME = "NetApp ONTAP";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This constant is declared in 3 places. Perhaps we could create a file in a single common dependency (maybe cloud-api) to declare the plugin names?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@winterhazel I did not find any suitable place in cloud-api for keeping this constant, It would be helpful if you could point out some place to keep this constant.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider should be the most appropriate place (this one is in cloud-engine-api, not cloud-api).

Comment on lines +155 to +159
} catch (Exception e) {
logger.error("Unexpected exception while creating disk-only VM snapshot for VM [{}]. Deleting leftover deltas.", vmName, e);
cleanupLeftoverDeltas(volumeObjectTos, mapVolumeToSnapshotSizeAndNewVolumePath, storagePoolMgr);
return new CreateDiskOnlyVmSnapshotAnswer(cmd, false,
String.format("Creation of disk-only VM snapshot for VM [%s] failed due to %s.", vmName, e.getMessage()), null);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this be unified with the catch block above?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@winterhazel, I added this logic separately after encountering failures in negative scenarios where the UI did not surface any error details. With this change, users are now notified of the failure reason when the exception falls outside the scope of the existing catch block. This is expected to improve overall user experience. Please let me know if you still feel this should be removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rajiv-jain-netapp got it. Notifying operators of why there was a failure is the right thing to do. I was just thinking about converting the two catches of this try to a single catch, as they execute pretty much the same things. This would be done by replacing catch (LibvirtException | QemuImgException e) with catch (Exception e) and keeping return new CreateDiskOnlyVmSnapshotAnswer(... instead of return new Answer(....

Comment on lines +415 to +416
logger.info("Other LUNs still active after removing /" + iqn + "/" + lun + " — session kept alive.");
return true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As the disconnect operation failed, I wonder if it makes more sense to throw an exception here instead

@rajiv-jain-netapp rajiv-jain-netapp force-pushed the sync/apache-main-apr-2026 branch from 10cb764 to c86d377 Compare May 5, 2026 11:46
logger.info("Deleting ONTAP volume by name: " + volume.getName() + " and uuid: " + volume.getUuid());
String authHeader = OntapStorageUtils.generateAuthHeader(storage.getUsername(), storage.getPassword());
try {
// TODO: Implement lun and file deletion, if any, before deleting the volume
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this going to be addressed in this PR, or separately?

CloudStackVolume cloudStackVolume = null;
FileInfo fileInfo = getFile(cloudStackVolumeMap.get(OntapStorageConstants.VOLUME_UUID),cloudStackVolumeMap.get(OntapStorageConstants.FILE_PATH));

if(fileInfo != null){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if(fileInfo != null){
if (fileInfo != null) {

@@ -180,11 +212,11 @@ public void disableLogicalAccess(Map<String, String> values) {

@Override
public Map<String, String> getLogicalAccess(Map<String, String> values) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This method does not seem to be used outside the tests. Is this expected?

}
}


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Methods from line 301-367 are not used. Is this expected?

} catch (CloudRuntimeException e) {
throw e;
} finally {
if (!result) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This if can be inverted to reduce indentation

deleteFlexVolSnapshots(flexVolDetails);
}

// Also handle legacy STORAGE_SNAPSHOT details (backward compatibility)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this needed for the ONTAP plugin?

revertFlexVolSnapshots(flexVolDetails);
}

// Also handle legacy STORAGE_SNAPSHOT details (backward compatibility)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this needed for the ONTAP plugin?

@piyush5netapp
Copy link
Copy Markdown

@winterhazel I have pushed changes addressing most of the changes you suggested except for the comments "This if can be inverted to throw early and reduce the indentation" where we can discuss more. Please re-review.
Also, let me know if you want me to resolve conversation 1 by 1, I can do that .

@winterhazel
Copy link
Copy Markdown
Member

@piyush5netapp thanks. I intend to have a look at the feedback and the new changes later today. I will resolve the open conversations that were already addressed as I read them.

@winterhazel winterhazel mentioned this pull request May 11, 2026
14 tasks
@winterhazel
Copy link
Copy Markdown
Member

@piyush5netapp @rajiv-jain-netapp I went through the reviews and resolved the ones that already seem addressed. Could you go through the comments that are still open and address them, or close with a comment if you judge it unnecessary (the indentation ones)?

 - extracted the ONTAP plugin name to interface nane to use it from one place.
 - Corrected indentation gaps.
@rajiv-jain-netapp
Copy link
Copy Markdown
Author

Thank you for your comments, @winterhazel.
I have updated the PR—please take a look at your convenience. I’ve addressed several of the pending items with additional commits today and have also provided responses to clarify some of the points raised.

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.

8 participants