sandeeplocharla commented on code in PR #13897:
URL: https://github.com/apache/cloudstack/pull/13897#discussion_r4027470363


##########
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:
##########
@@ -1750,6 +1773,23 @@ private void 
postSnapshotDirectlyToSecondary(SnapshotInfo snapshot, SnapshotInfo
         snapshotDetailsDao.removeDetail(snapshotOnPrimary.getId(), 
AsyncJob.Constants.MS_ID);
     }
 
+    /**
+     * Returns true when a volume snapshot on NetApp ONTAP is explicitly kept 
on managed primary/array storage.
+     *
+     * <p>For ONTAP managed pools, {@link #updateSnapshotPayload} defaults 
{@code locationType} to
+     * {@link Snapshot.LocationType#PRIMARY}. ONTAP volume snapshots therefore 
stay on the FlexVol
+     * on primary — they are not moved or mirrored to secondary storage. The 
primary
+     * {@code snapshot_data_store} row must remain so volume-snapshot DELETE 
uses
+     * {@code StorageSystemSnapshotStrategy} and the primary datastore 
driver.</p>
+     *
+     * <p>Other managed storage providers are not affected by this check.</p>
+     */
+    private boolean isManagedPrimaryLocationSnapshot(StoragePool storagePool, 
CreateSnapshotPayload payload) {
+        return storagePool != null && storagePool.isManaged()
+                && 
DataStoreProvider.ONTAP_PLUGIN_NAME.equals(storagePool.getStorageProviderName())

Review Comment:
   The ONTAP check is required here and does not change snapshot behavior for 
other providers.
   `updateSnapshotPayload()` defaults `locationType` to PRIMARY for any managed 
pool. This skip is extra-gated on `DataStoreProvider.ONTAP_PLUGIN_NAME`, so 
other managed PRIMARY snapshots still follow the existing archive path.
   `(ONTAP || PRIMARY)` would skip secondary archive for non-ONTAP managed 
PRIMARY snapshots, so did not apply that. But renamed the helper to 
`isOntapManagedPrimaryLocationSnapshot` to make the ONTAP-only intent obvious.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to