Recently we had clean up drive in our Amazon Web Services account. We deleted more than 200 AMIs. Because snapshots for these AMIs did not to delete on delete of AMI.

How can I find list of snapshots created by AMIs where the AMI which created snapshot is deleted?

I couldnt find anything from AWS management console or AWS CLI.


4 Answers 4


If you have only been creating snapshots at AMI creation time, you may be able to reliably do this with the CLI or powershell tools:

  • Get all EC2 snapshots created by your AWS Account (OwnerID = your aws account)
  • Get Snapshots associated with still running Volumes
    • Of these snapshots, attempt to match their VolumeID with the VolumeID of still running Volumes. Output the SnapshotID of matches.
  • Get Orphaned Snapshots/Volumes
    • Of these snapshots, attempt to match their VolumeID with the VolumeID of still running Volumes. Output the SnapshotID of snapshots that aren't matched with still running volumes.

You'll need:

That won't identify that these volumes were generated along with AMIs that you want to delete, though... only that they've been orphaned. Consider saving yourself a lot of future headache and tag your EC2 volumes at creation time with some simple metadata about who was responsible for creating them, and what they were created for.

  • I need to keep some of the recently created AMIs which are unused as it is. Just need to delete older ones. So out of 100 i need to delete let's say 70 and keep 30 untouched. For those 70 snapshots created along with AMIs I need to delete those only. Is there a way to find those in AWS CLI? Jul 14, 2014 at 3:48
  • Check the output as listed in the documentation of ec2-describe-volumes. It outputs a set of metadata that you can use to filter a subset from the entire returned set... for your case, it sounds like you would want to query against the creation timestamp with your specified cutoff date. In the future, if you start tagging, you can match against any arbitrary string tagged onto the volume (a keyword, environment name, version number... things like that). After some testing and you're comfortable with the selected subset of volumes, feel free to delete. Jul 14, 2014 at 14:21

If you try to delete a snapshot that's tied to an existing AMI, it will give an error and ask you if you're sure.

What I did was selected all of my snapshots and clicked delete, and then just pressed cancel when it let me know that some AMIs were still tied to existing AMIs. Probably the fastest yet scariest way to solve this problem.


I have written a small python script which generates csv raport with all information about snapshot usage. It includes information about linked volumes, instances and amis.



An updated answer to the question using today's tools: I had the same problem and was disappointed with the options presented here. Fortunately you can now log in to Amazon Cloudtrail and filter by time, Event name: DeregisterImage,
Resource type: EC2 Ami.

This will give you a list of AMI IDs (downloadable CSV if you like) that you can use to search in the snapshots.

  • Not sure how this list of deregistered AMI's is helpful against a list of snapshot information since there is no mention in the deregistered AMI list about which snapshot or volume was on the AMI that could be used to create such a link. Please elaborate.
    – KoZm0kNoT
    May 1 at 20:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .