sureshanaparti commented on code in PR #13897:
URL: https://github.com/apache/cloudstack/pull/13897#discussion_r3977500524
##########
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:
@sandeeplocharla is ontap check required here? this might break other
snapshots on the primary storage. if this method is specific to ONTAP, you can
update the method name accordingly.
or it should be
`(DataStoreProvider.ONTAP_PLUGIN_NAME.equals(storagePool.getStorageProviderName())
|| Snapshot.LocationType.PRIMARY.equals(payload.getLocationType())`
--
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]