Instances and AMIs Information FAQ
How durable are the instance stores?
Instance stores appear to an instance as a local disk. They will survive intentional and unintentional reboots of the instance unless the instance terminates or the underlying drive fails.
You should always backup or replicate important data.
What happens to my running instances if the machines on which they are running fail?
The instances terminate and need to be relaunched. The data on the instance stores is lost. Any data on Amazon EBS volumes (including the root device for Amazon EBS-backed instances) is preserved.
Always replicate important data, use Amazon EBS, or store it in Amazon S3.
What are the differences between stopping and terminating an instance?
The instance will first perform a normal shutdown in both cases. If the instance was stopped, it will then transition to a stopped state, all of its Amazon EBS volumes will remain attached, and it can then be started again at a later time. If the instance was terminated, attached Amazon EBS volumes will be deleted where the associated deleteOnTerminate instance attribute is set to true. The instance itself will also be deleted, and the instance cannot be started again at a later date.
If you wish to disable termination via the TerminateInstances API for increased safety, ensure that the disableApiTermination attribute is set to true for the instance. To control the behavior of an on instance shutdown such as shutdown –h in linux or shutdown in windows set the instanceInitiatedShutdownBehavior instance attribute to stop or terminate as desired. Instances that have Amazon EBS volume root devices will default to stop, instances with instance-store root devices will always be terminated as the result of an on instance shutdown.
How does stopping and starting an instance effect how it is charged?
You will not be charged for additional instance hours while the instance is in a stopped state. A full instance hour will be charged for every transition from a stopped state to a running state, even if this happens multiple times within a single hour. If the instance type was changed while the instance was stopped, you will be charged at the new instance type’s rate once the instance has been started. All of the associated Amazon EBS usage of your instance, including root device usage, will be charged at the typical Amazon EBS prices.
What can I do with a stopped instance?
Amazon EBS volumes can be attached to or detached from the instance. The CreateImage call can be used to create an AMI from the instance. The kernel, ramdisk, and instance type can be changed with the ModifyInstanceAttribute call. The instance can be started with the StartInstances call and can be terminated with the TerminateInstances call.
What limitations exist for stopped instances?
In addition to the limit on running instances, there is an additional limit on the overall number of instances that you can have (whether running, stopped, or in any other state except for terminated.) This overall instance limit is 2 times your running instance limit. The running instance limit can be increased upon request via the instance limit request form.
Do I need to share the Amazon EBS snapshots that an AMI references in order to share the AMI?
No, only the AMI itself needs to be shared. The system will automatically provide the instance access to the referenced Amazon EBS snapshots for the purposes of the launch.
How can I control how block devices are exposed to my instance?
You may control how block devices are exposed in your instance by configuring the block device mapping in a RunInstances call, in a stopped instance by using the ModifyInstanceAttribute call, and in an AMI by having a snapshot attached during a CreateImage call. Using these calls, you can configure the your instance to start with a specific snapshot mounted, use the rootDeviceName field to specify the name of the instance’s the root device when the instance is booted, and you may also gain access to the local instance stores as instance stores are never exposed by default on instances backed by Amazon EBS. An example of an instance block device mapping would be device /dev/sdc mapped to vol-1234abcd.