Skip to content

Storage / Task

Delete a snapshot

Updated · 2 min read

Unprotect a snapshot if needed, delete it, and confirm that it reports DELETED so it no longer blocks deleting its volume.

On this page6 sections

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

Unprotect the snapshot

Skip this section if the snapshot reports protectionStatus: UNPROTECTED.

  1. Unprotect the snapshot. This works on a COMPLETED snapshot and on an ERROR snapshot, and also settles a snapshot whose protectionStatus is FAILED.

    terminal
    origin storage unprotect-snapshot --snapshot-urn <snapshot-urn>

    With the API, use the unprotectSnapshot mutation:

    GraphQL
    mutation {
      pvs {
        unprotectSnapshot(input: { snapshotUrn: "<snapshot-urn>" }) {
          accepted
          message
        }
      }
    }
  2. Check the snapshot until it reports protectionStatus: UNPROTECTED.

    terminal
    origin storage get-snapshot --snapshot-urn <snapshot-urn>

Delete the snapshot

  1. Delete the snapshot.

    terminal
    origin storage delete-snapshot --snapshot-urn <snapshot-urn>

    With the API, use the deleteSnapshot mutation:

    GraphQL
    mutation {
      pvs {
        deleteSnapshot(input: { snapshotUrn: "<snapshot-urn>" }) {
          accepted
          message
        }
      }
    }

    A delete request for a snapshot that isn’t UNPROTECTED is refused with the message snapshot must be unprotected before it can be deleted.

  2. Check the snapshot until it reports status: DELETED.

    terminal
    origin storage get-snapshot --snapshot-urn <snapshot-urn>

    A deleted snapshot drops out of origin storage list-snapshots at 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.

Next steps