Paid Snapshots & Batch removing snapshots

August 16, 2016 491 views
Billing Control Panels


I just got a mail that Snapshots is going to be paid. I've got multiple snapshots spread accross 2 accounts (one for each company) and I want to batch remove some old ones, otherwise this is going to be pretty expensive over here :) I was wondering if that's possible? Thanks!

2 Answers

Our command line client, doctl would make deleting multiple snapshots from your account quite simple. To list all of your images, use:

  • doctl compute image list-user

This allows you to retrieve their image IDs. Using the IDs, you could write a small script to delete in bulk:


for i in 123456 789012; do
    doctl compute image delete "$i"

If you wanted to delete all the snapshots on your account, you could do something like:


doctl compute image list-user -o json | jq -c '.[] | select(.type == "snapshot") | .id' | while read i; do
    doctl compute image delete "$i"

Of course, our API also supports deleting images. There are libraries in a number of different languages as well.

DigitalOcean's web based control panel provides a convenient, point-and-click interface for managing Droplets. There are many times, however, when a command-line tool may be a preferable alternative. doctl, the official DigitalOcean command-line client, leverages the DigitalOcean API to provide access to most account and Droplet features.

For people that don't use the API this is a big problem. I think DO should make this feature available from their control panel or at least be able to do this when a Support Ticket is raised.

Unfortunately I raised a ticket and was told that DO will not do this on my behalf and I would need to delete each one manually. That's going to take quite a bit of time.

There is a feature request here but I doubt it'll be available in time for the start of the Snapshot billing:



Have another answer? Share your knowledge.