How to Delete Snapshots
-
by Blog Admin
- 7
How to Delete Snapshots
Permanently removes the selected resource from your Vultr account.
Deleting snapshots completely removes the resource from your account. You should only do this operation after restoring a snapshot to a Vultr Cloud Compute instance or after provisioning a Vultr Cloud Compute instance using the snapshot image. After deleting a snapshot, you can’t undo the operation, so you should take great care.
Follow this guide to delete snapshots using the Vultr Customer Portal, API, CLI, or Terraform.
Vultr Customer Portal
- Navigate to Products and select Orchestration.
- Click Snapshots. Select the target snapshot from the list and click the delete icon to remove the snapshot.
- Click Remove Snapshot to confirm.
Vultr API
- Send a
GET
request to the List Snapshots endpoint to list all snapshots.console$ curl "https://api.vultr.com/v2/snapshots" \ -X GET \ -H "Authorization: Bearer ${VULTR_API_KEY}"
- Send a
DELETE
request to the Delete Snapshot endpoint specifying a snapshot ID to delete a snapshot.console$ curl "https://api.vultr.com/v2/snapshots/snapshot_id" \ -X DELETE \ -H "Authorization: Bearer ${VULTR_API_KEY}"
Visit the Delete Snapshot endpoint to view additional attributes to add to your request.
Vultr CLI
- List all snapshots and note the target snapshot’s ID.
console
$ vultr-cli snapshot list
- Delete a snapshot by specifying a snapshot ID.
console
$ vultr-cli snapshot delete snapshot_id
Run
vultr-cli snapshot delete --help
to view all options.
Terraform
- Open your Terraform configuration where the snapshot resource was created.
- Remove the
vultr_snapshot
resource block, or destroy it by target.terraformresource "vultr_snapshot" "weekly" { instance_id = var.instance_id description = "Weekly-Snapshot-14-08-2024" } # To delete, either remove this block from configuration # or run: terraform destroy -target vultr_snapshot.weekly
- Apply the configuration and observe the following output:
Apply complete! Resources: 0 added, 0 changed, 1 destroyed.
How to Delete Snapshots Permanently removes the selected resource from your Vultr account. Deleting snapshots completely removes the resource from your account. You should only do this operation after restoring a snapshot to a Vultr Cloud Compute instance or after provisioning a Vultr Cloud Compute instance using the snapshot image.…
How to Delete Snapshots Permanently removes the selected resource from your Vultr account. Deleting snapshots completely removes the resource from your account. You should only do this operation after restoring a snapshot to a Vultr Cloud Compute instance or after provisioning a Vultr Cloud Compute instance using the snapshot image.…