Why do I get an error "The snapshot is currently in use by AMI" when I try to delete an EBS snapshot, even though there is no AMI on the account?

2 minuto de leitura
Nível de conteúdo: Intermediário

This article provides a step-by-step guide for users who encounter an error while trying to delete a snapshot, stating that the snapshot is currently in use by an AMI, even when no AMI appears to be present on the account. The solution involves deregistering the AMI before deleting the snapshot.

While trying to delete a snapshot. The error message states that the snapshot is currently in use by an Amazon Machine Image (AMI), even though there appears to be no AMI present on your account. This issue typically arises when an AMI has been disabled but not deregistered.

Enter image description here

The Importance of Deregistering AMIs

Before you can delete an Elastic Block Store (EBS) snapshot, you must first deregister the associated AMI. If an AMI is merely disabled, it will not appear on the AMIs page if the filter is set to 'Owned by me'. And, we presume that there is no AMI present on the account. Enter image description here

How to Deregister a Disabled AMI

To resolve this issue, you need to change the filter on the AMI page from 'Owned by me' to 'Disabled images'. Once you switch to 'Disabled images', the list of disabled images will be displayed.

Enter image description here

You can view disabled AMIs in the EC2 console and by using the AWS CLI.

You must be the AMI owner to view disabled AMIs. Because disabled AMIs are made private, you can't view disabled AMIs if you're not the owner.

Please refer Describe disabled AMIs for more info.

From this list, find the AMI associated with the snapshot you wish to delete. Select that AMI, click on 'Actions', and then choose 'Deregister'. Please note that the deregistration process may take a few moments to complete.

Enter image description here

Deleting the EBS Snapshot

Once you've successfully deregistered the AMI, you'll be able to delete the EBS snapshot. Remember to always deregister and not to disable any AMIs before attempting to delete associated snapshots to avoid encountering this error in the future.

Please refer Delete an Amazon EBS snapshot for more information on the same.

Enter image description here


Amazon EC2 now supports setting AMIs to a disabled state

profile pictureAWS
publicada há 5 meses3878 visualizações
3 Comentários

This is very informative Dnyaneshwar!

profile pictureAWS
respondeu há 5 meses

Appreciate the user-friendly, clear information.

respondeu há 5 meses

So, in this case, I deleted the AMI before the deregister, and now I can't delete the Snapshot. How can I proceed?

respondeu há 5 meses