how to list all the snapshots created from a single volume ID EC2 instance

流过昼夜 提交于 2020-01-02 09:59:11

问题


In the past few months our snapshots backup volume increases and hence our monthly bill in amazon EC2. Now i wanted to delete some of our old EC2 snapshots. So here is the question:

How to find all the snapshots created from a single Volume ID using EC2 command line tool? I tried ec2-describe-snapshots but this list all the snapshots. We have lots of snapshots and it is very difficult for me to note them down one by one.


回答1:


aws ec2 describe-snapshots --filters "Name=volume-id, Values=vol-1234,vol-5678"

to get the values of only the snapshot-ids and the corresponding volumes:

aws ec2 describe-snapshots --filters "Name=volume-id, Values=vol-1234,vol-5678" --query 'Snapshots[*].{SnapshotId:SnapshotId,VolumeId:VolumeId}' --output table

Refer : http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html




回答2:


Do ec2-describe-snapshots --filter "volume-id=vol-12345".

Well documented.



来源:https://stackoverflow.com/questions/18513406/how-to-list-all-the-snapshots-created-from-a-single-volume-id-ec2-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!