dataSource:
name: volumesnapshot-test-pvc-nfs-retain
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
Error: could not get snapshot snapshot-abb03b32-432c-4c63-b550-a571050b787e: 404 Not Found
command terminated with exit code 1
C。 Tridentctl 删除快照
Error: could not delete snapshot snapshot-abb03b32-432c-4c63-b550-a571050b787e: 404 Not Found
command terminated with exit code 1
如果这是一个错误,请查看它,否则,这会导致 trident 中有很多剩余的快照对象。 现在请提供有关如何使用 deletePolicy is Retain 删除三叉戟快照对象的说明/指导?
dataSource:
name: volumesnapshot-test-pvc-nfs-delete
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
使用deleteRetain成功删除Trident Snapshot对象:Delete
在这种情况下,它们会在删除volumesnapshots.snapshot.storage.k8s.io后自动删除
环境
提供有关环境的准确信息,以帮助我们重现问题。
嗨@gnarl ,有什么更新吗?
此问题对 Element OS(也可能是 E 系列)有更明显的影响,因为这些平台上的最大快照数量低于 ONTAP:在 ONTAP 上,“唯一”问题是剩余快照,而在 Element OS 上,快照保护停止工作因为如果没有自动过期,快照的最大数量会在几天内达到。
@khankth ,
我认为这里的问题是volumeSnapshotContent 的deletePolicy 为“Retain”,如果目标是实际删除快照,则应在删除volumeSnapshot 和volumeSnapshotConent 之前将其更新为“Delete”。 这与删除 reclaimPolicy 设置为“保留”的 PV 的工作方式不同。 在这种情况下,K8S 会强制您设置编辑 PV 并将 reclaimPolicy 更改为“Delete”,然后才能成功删除 PV。
我将与团队讨论如何处理这个用例。
@khankth使用tridentctl
删除快照时,您需要按如下方式使用它:
tridentctl delete snapshot -h
Delete one or more volume snapshots from Trident
Usage:
tridentctl delete snapshot <volume/snapshot> [<volume/snapshot>...] [flags]
Aliases:
snapshot, s, snap, snapshots
Flags:
--all Delete all snapshots
-h, --help help for snapshot
--volume string Delete all snapshots in volume
Global Flags:
-d, --debug Debug output
-n, --namespace string Namespace of Trident deployment
-o, --output string Output format. One of json|yaml|name|wide|ps (default)
-s, --server string Address/port of Trident REST interface
# tridentctl delete snapshot snapshot-9c214e0f-547d-41b5-923d-a075bcc97d8a pvc-fb6eabff-93b4-4df5-b5ab-943bcda44ad8 -n trident
Error: could not delete snapshot snapshot-9c214e0f-547d-41b5-923d-a075bcc97d8a: 404 Not Found
command terminated with exit code 1
# tridentctl delete snapshot pvc-fb6eabff-93b4-4df5-b5ab-943bcda44ad8/snapshot-9c214e0f-547d-41b5-923d-a075bcc97d8a -n trident
# tridentctl get snapshot -n trident
+------+--------+
| NAME | VOLUME |
+------+--------+
+------+--------+
此外,您指出的另一个错误 [ tridentctl get snapshot
不返回快照的详细信息] 已在此提交中的 v21.04 中修复。