Can I delete original EC2 instance after creating an image out of it?

回眸只為那壹抹淺笑 提交于 2020-01-06 04:03:26

问题


I've setup a EC2 instance with EBS root. As part of the process, the system has created a snapshot of its EBS volume. My doubt is what happens when I remove the EC2 instance (and its EBS volume).

After deleting the EBS volume, will the snapshot still have the full copy of my system? Will I be able to restore a copy of my system in future out of the AMI?

Thanks


回答1:


If you create an AMI from an EC2 instance, you can terminate the instance and create a new one from the AMI.

If you have taken a snapshot of the EBS boot volume the instances is using, you will need to register it as an AMI before you can create a new instance.

If you take a snapshot of a volume, and then delete the original volume, you can recreate the volume from the snapshot even if the original volume is deleted.




回答2:


Here's Amazon's default termination behaviors for EBS-backed instances:

By default, the root device volume and the other Amazon EBS volumes attached when you launch an Amazon EBS-backed instance are automatically deleted when the instance terminates. For information about how to change this behavior when you launch an instance, see Changing the Root Device Volume to Persist.

By default, any Amazon EBS volumes that you attach to a running instance are detached with their data intact when the instance terminates. You can attach a detached volume to any running instance.

If you create an AMI from your EBS-backed instance, a separate volume will be created when you launch a new instance based on that AMI with your data persisted from the time of the last snapshot of that volume.

More info about Root Device Storage



来源:https://stackoverflow.com/questions/20352244/can-i-delete-original-ec2-instance-after-creating-an-image-out-of-it

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