Delete a snapshot when you no longer need it, or to clear the way for deleting the volume it was taken from. A protected snapshot must be unprotected first.
Before you begin
- The snapshot’s URN.
- Permission
pvs.snapshot.deleteon the snapshot, andpvs.snapshot.unprotectif it’s protected. See Roles. - A snapshot that reports
COMPLETEDorERROR. APENDINGsnapshot can’t be deleted yet; wait until the copy finishes.
Important: The platform doesn’t check whether an image uses the snapshot. Once you unprotect or delete a snapshot, creating volumes from it and launching instances from an image built on it are refused.
Unprotect the snapshot
Skip this section if the snapshot reports protectionStatus: UNPROTECTED.
-
Unprotect the snapshot. This works on a
COMPLETEDsnapshot and on anERRORsnapshot, and also settles a snapshot whoseprotectionStatusisFAILED.Terminal window origin storage unprotect-snapshot --snapshot-urn <snapshot-urn>With the API, use the
unprotectSnapshotmutation:mutation {pvs {unprotectSnapshot(input: { snapshotUrn: "<snapshot-urn>" }) {acceptedmessage}}} -
Check the snapshot until it reports
protectionStatus: UNPROTECTED.Terminal window origin storage get-snapshot --snapshot-urn <snapshot-urn>
Delete the snapshot
-
Delete the snapshot.
Terminal window origin storage delete-snapshot --snapshot-urn <snapshot-urn>With the API, use the
deleteSnapshotmutation:mutation {pvs {deleteSnapshot(input: { snapshotUrn: "<snapshot-urn>" }) {acceptedmessage}}}A delete request for a snapshot that isn’t
UNPROTECTEDis refused with the messagesnapshot must be unprotected before it can be deleted. -
Check the snapshot until it reports
status: DELETED.Terminal window origin storage get-snapshot --snapshot-urn <snapshot-urn>A deleted snapshot drops out of
origin storage list-snapshotsat once. You can still look it up by URN, with no time limit.
If this fails
If the deletion is accepted but fails, the snapshot stays in your list as ERROR with a statusReason. Its copy may still exist, and it still blocks deleting its volume. Delete it again. If it’s still protected, unprotect it first.