Reputation: 183
I am trying to delete orphaned snapshots, but the query I am using keeps giving me snapshots that are deleted. Is there a query I can use to avoid deleted snapshots?
aws ec2 describe-snapshots --snapshot-id snap-00012345cac2b3de1
{
"Snapshots": [
{
"Description": "DescriptionHere",
"Encrypted": false,
"OwnerId": "123456088429",
"Progress": "100%",
"SnapshotId": "snap-00012345cac2b3de1",
"StartTime": "2018-01-24T06:42:50+00:00",
"State": "completed",
"VolumeId": "vol-00123dc456ad5117",
"VolumeSize": 6,
"StorageTier": "standard"
}
]
}
Upvotes: 0
Views: 537
Reputation: 269666
To test your situation, I did the following:
snap-036851d7351b78712
aws ec2 describe-snapshots --snapshot-id snap-036851d7351b78712
An error occurred (InvalidSnapshot.NotFound) when calling the DescribeSnapshots operation: The snapshot 'snap-036851d7351b78712' does not exist.
So, I was unable to reproduce your situation.
I then wondered whether the Snapshot might be associated with an AMI. I did the following:
snap-047563373ab4c1088
snap-047563373ab4c1088: The snapshot snap-047563373ab4c1088 is currently in use by ami-0fc62425d087dbbe8
I then 'deregistered' (deleted) the AMI and it told me that the associated Snapshot would not be deleted:
describe-snapshots
and it said that the snapshot did not existSo, perhaps your Snapshot is associated with an AMI and it was never actually deleted?
Upvotes: 1