CSTACKEX-158: if ontap snapshot are already delete from ontap side, d…#82
Open
rajiv-jain-netapp wants to merge 1 commit into
Open
CSTACKEX-158: if ontap snapshot are already delete from ontap side, d…#82rajiv-jain-netapp wants to merge 1 commit into
rajiv-jain-netapp wants to merge 1 commit into
Conversation
…eletion of CS side of snapshot should not fail on not finding ontap snapshot.
rajiv-jain-netapp
requested review from
piyush5netapp,
sandeeplocharla and
suryag1201
as code owners
July 20, 2026 09:07
There was a problem hiding this comment.
Pull request overview
This PR makes ONTAP snapshot deletion idempotent from CloudStack’s perspective: if the backend ONTAP snapshot is already gone, CloudStack-side deletion should not fail.
Changes:
- Add a shared helper (
OntapStorageUtils.isOntapSnapshotNotFoundError) to recognize “snapshot already missing” errors. - Update ONTAP snapshot delete workflows to treat those errors as success (both in
StorageStrategyandOntapPrimaryDatastoreDriver). - Add/extend unit tests to cover the new behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageUtils.java | Introduces shared “snapshot not found” detection helper used by delete paths. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java | Wraps FlexVol snapshot deletion with “already absent” handling. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java | Replaces local matcher with shared helper for delete idempotency. |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/utils/OntapStorageUtilsTest.java | Adds tests for the new helper (with recommended regression coverage). |
| plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/StorageStrategyTest.java | Adds a test ensuring delete succeeds when ONTAP reports the snapshot is missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Deletion of CS side of snapshot should not fail on not finding ontap snapshot.
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Test -1: Ran VM snapshot delete operation when the respective snapshot is not available at ONTAP, it passed.
Test -2: Ran VM snapshot delete operation when the respective snapshot is available at ONTAP; it passed
Test -3: Ran cloudstack volume snapshot delete workflow when the respective snapshot is not available at ONTAP, it passed.
Test -4: Ran cloudstack volume snapshot delete workflow when the respective snapshot is available at ONTAP, it passed.
How did you try to break this feature and the system with this change?