Skip to content

Storage / Task

Delete a volume

Updated · 3 min read

Delete a volume you no longer need, after detaching it and deleting its snapshots, and confirm that it reports DELETED and frees its quota.

On this page6 sections

Delete a volume to remove its data and stop paying for it. Deleting frees the volume’s share of your storage quota once the deletion completes. You can’t undo a delete.

Before you begin

Clear what blocks the delete

  1. Check the volume’s status. If it’s INUSE, find the instance and detach the volume. See Find the instance a volume is attached to.

    terminal
    origin storage get-volume --volume-urn <volume-urn>
  2. Find the volume’s snapshots. Every snapshot reports the volume it was taken from as volumeUrn. List your project’s snapshots with the API and look for that URN:

    GraphQL
    query {
      pvs {
        snapshots(input: { projectUrn: "<project-urn>" }) {
          urn
          volumeUrn
          status
          protectionStatus
        }
      }
    }
  3. Delete each of those snapshots, unprotecting it first if needed, and wait until each reports DELETED. See Delete a snapshot.

Delete the volume

  1. Delete the volume.

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

    With the API, use the deleteVolume mutation:

    GraphQL
    mutation {
      pvs {
        deleteVolume(input: { volumeUrn: "<volume-urn>" }) {
          accepted
          message
        }
      }
    }
  2. Check the volume until it reports DELETED.

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

    A deleted volume drops out of origin storage list-volumes at once. You can still look it up by URN, with no time limit.

What the platform refuses

These requests are refused immediately with an error, and nothing about the volume changes:

RequestWhat happens
The volume is attachedThe error names the attachment that holds the volume. Detach the volume, or terminate the instance, and try again.
The volume has snapshotsThe error names each snapshot that blocks the delete. Delete those snapshots first, then try again.
The volume is already being deletedA volume in DELETING or DELETED can’t be deleted again.

You can delete a volume in ERROR. That’s how you clean up a volume whose creation or deletion failed.

If this fails

If the deletion is accepted but fails, the volume stays in your list as ERROR with a statusReason, and its disk may still exist. It still counts against your quota. Delete it again. See Troubleshoot storage.