Skip to content

NetApp: create CS volume and template from CS volume snapshot - #14517

Open
rajiv-jain-netapp wants to merge 5 commits into
apache:mainfrom
NetApp:feature/CSTACKEX-306-create-from-snapshot
Open

rajiv-jain-netapp wants to merge 5 commits into
apache:mainfrom
NetApp:feature/CSTACKEX-306-create-from-snapshot

Conversation

@rajiv-jain-netapp

@rajiv-jain-netapp rajiv-jain-netapp commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR...

  1. Enable user to create cloudstack volume from the cloudstack-volume-snapshot which is expected to get persisted in the same primary storage pool.
  2. Enable user to create template from the cloudstack-volume-snapshot and get it persisted in the secondary storage.

Behaviour:

  1. Created CS volume would always be of type DATA. Even from the ROOT cloudstack-volume-snapshot, user can create DATA type of CS-volume.
  2. User can create and attach or only create the CS-volume from the CS-volume-snapshot.
  3. User can use create template option from the CS-volume-snapshot if user wants to create template.
  • 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):

  • First created the CS-volume-snapshots
image
  • created data type of volume from the snapshot as below
image
  • then created CS-volume and also attaching the same in the same request, with the existing VM
image image
  • create template from the snapshot
image image

rajiv-jain-netapp and others added 4 commits September 24, 2026 20:34
Enable the managed-storage template cache flow for the ONTAP primary
storage plugin so that VM root volumes are cloned from a template copy
kept on the pool's FlexVolume instead of being copied from secondary
storage for every deployment.

- Advertise CAN_CREATE_VOLUME_FROM_VOLUME from the datastore driver.
- Create the template cache on primary: an iSCSI LUN (identity tracked on
  template_spool_ref) or a qcow2 file for NFS, populated by the KVM host.
- Clone new volumes from the cached template: LUN clone for iSCSI and
  ONTAP file clone (FileCloneRequest) for NFS, growing the clone when the
  disk offering is larger than the template.
- Clean up the cached LUN/file when the template is removed from the pool;
  a missing file is treated as already deleted.
- Move protocol-specific create/clone/resize logic into
  UnifiedSANStrategy and UnifiedNASStrategy, and add a StorageStrategy
  helper to poll an optional async job.
- Add unit tests for the driver and the NAS/SAN strategies.
Stack the snapshot-clone paths onto the ONTAP template-cache branch so a
volume or template can be created from a CloudStack volume snapshot that
already lives on the same primary pool.

- Clone a data volume from a snapshot on the same FlexVolume (iSCSI LUN
  clone or NFS file clone). A root snapshot still produces a data volume;
  the bootable path is create-template-from-snapshot.
- Copy a snapshot into a temporary volume when creating a template, then
  remove that temporary volume record after the copy.
- Grow the clone when the disk offering is larger than the snapshot, and
  delete the orphaned clone if resize fails.
- Keep template-cache behavior for clone-from-template, including the
  existing pool types (Iscsi and NetworkFilesystem) on this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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.

@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.88%. Comparing base (b9b5436) to head (14fc0eb).
⚠️ Report is 16 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (b9b5436) and HEAD (14fc0eb). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (b9b5436) HEAD (14fc0eb)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #14517       +/-   ##
=============================================
- Coverage     20.75%    3.88%   -16.88%     
=============================================
  Files          6496      493     -6003     
  Lines        591602    42571   -549031     
  Branches      72583     8069    -64514     
=============================================
- Hits         122814     1653   -121161     
+ Misses       455456    40687   -414769     
+ Partials      13332      231    -13101     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 19936

This branch has not been deployed

No deployments
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.

3 participants