ec2 instance stop和terminate区别

Life is short , play more!
本文来自lihao's Blog,转载请注明。

Amazon可以终止或者关闭一个运行的instance(实例)。关闭一个instance,该instance必须是基于一个EBS-based AMI的实例。对于终止和关闭一个instance,是有一些区别的。所以最好了解。The key difference between stopping and terminating an instance is that the attached bootable EBS volume will not be deleted.

Terminate Instance

终止会将instance关闭,并永久性的删除。所有存在instance里的数据和attach的EBS卷数据也会永久性删除。When you terminate an EC2 instance, the instance will be shutdown and the virtual machine that was provisioned for you will be permanently taken away and you will no longer be charged for instance usage.  Any data that was stored locally on the instance will be lost.  Any attached EBS volumes will be detached and deleted.  However, if you attach an EBS Snapshot to an instance at boot time, the default option in the Dashboard is to delete the attached EBS volume upon termination.

Stop Instance

关闭instance后,虚拟机(及其数据)将会被保留,只是处于未使用状态(不可使用)。所以此时将不会进行付费。When you stop an EC2 instance, the instance will be shutdown and the virtual machine that was provisioned for you will be permanently taken away and you will no longer be charged for instance usage.  The key difference between stopping and terminating an instance is that the attached bootable EBS volume will not be deleted.  The data on your EBS volume will remain after stopping while all information on the local (ephemeral) hard drive will be lost as usual.  The volume will continue to persist in its availability zone.  Standard charges for EBS volumes will apply.  Therefore, you should only stop an instance if you plan to start it again within a reasonable timeframe.  Otherwise, you might want to terminate an instance instead of stopping it for cost saving purposes.

The ability to stop an instance is only supported on instances that were launched using an EBS-based AMI where the root device data is stored on an attached EBS volume as an EBS boot partition instead of being stored on the local instance itself.  As a result, one of the key advantages of starting a stopped instance is that it should theoretically have a faster boot time.  When you start a stopped instance the EBS volume is simply attached to the newly provisioned instance.  Although, the AWS-id of the new virtual machine will be the same, it will have new IP Addresses, DNS Names, etc.  You shouldn’t think of starting a stopped instance as simply restarting the same virtual machine that you just stopped as it will most likely be a completely different virtual machine that will be provisioned to you.

For more information about what really happens during each server/instance state, please see Server States.


发表评论

电子邮件地址不会被公开。 必填项已用*标注