Skip to content

CSTACKEX-158: if ontap snapshot are already delete from ontap side, d…#82

Open
rajiv-jain-netapp wants to merge 1 commit into
mainfrom
feature/CSTACKEX-158
Open

CSTACKEX-158: if ontap snapshot are already delete from ontap side, d…#82
rajiv-jain-netapp wants to merge 1 commit into
mainfrom
feature/CSTACKEX-158

Conversation

@rajiv-jain-netapp

@rajiv-jain-netapp rajiv-jain-netapp commented Jul 20, 2026

Copy link
Copy Markdown

…Deletion of CS side of snapshot should not fail on not finding ontap snapshot.

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):

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?

…eletion of CS side of snapshot should not fail on not finding ontap snapshot.

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 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 StorageStrategy and OntapPrimaryDatastoreDriver).
  • 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.

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.

2 participants