| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
You can stop and restart Amazon EC2 instances that use Amazon EBS volumes as their root devices.
Note
If you try to stop an instance that uses an instance store as its root device, you receive an error.
When an instance is stopped, it is shut down, and any data stored in RAM is not preserved. You're not billed for hourly usage or data transfer, but you're billed for any Amazon EBS volume storage. You can start the instance at any time with a start request. Each time you transition an instance from stopped to started, we charge a full instance hour, even if transitions happen multiple times within a single hour.
For information about the differences between stopping an instance and terminating an instance, see Stopping Instances.
To stop and start an instance
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
Click Instances in the Navigation pane.
The console displays a list of running instances.
Select an instance, select Instance Actions, and click Stop Instance.
A confirmation dialog box appears.
Click the Yes, Stop Instance.
The instance is stopped and saved as a snapshot.
To restart the stopped instance, select Stopped Instances from the Viewing list box.
The newly stopped instance appears in the list.
Select the instance, select Instance Actions, and click Start Instance.
The instance begins restarting.
To stop and start an instance
Use the ec2-stop-instances command to stop an instance.
PROMPT>ec2-stop-instancesi-10a64379
Amazon EC2 returns output similar to the following example.
IMAGE i-10a64379 running stopping Use the ec2-start-instances command to restart the instance.
PROMPT>ec2-start-instancesi-10a64379
Amazon EC2 returns output similar to the following example.
IMAGE i-10a64379 stopped pending To stop and start an instance
Construct the following Query request to stop an instance.
https://ec2.amazonaws.com/ ?Action=StopInstances &InstanceId.1=i-10a64379 &AUTHPARAMS
The following is an example response.
<StopInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<instancesSet>
<item>
<instanceId>exampleinstanceid</instanceId>
<currentState>
<code>64</code>
<name>stopping</name>
</currentState>
<previousState>
<code>16</code>
<name>running</name>
</previousState>
</instancesSet>
</StopInstancesResponse>Construct the following Query request to restart the instance.
https://ec2.amazonaws.com/ ?Action=StartInstances &InstanceId.1=i-10a64379 &AUTHPARAMS
The following is an example response.
<StartInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<instancesSet>
<item>
<instanceId>i-10a64379</instanceId>
<currentState>
<code>0</code>
<name>pending</name>
</currentState>
<previousState>
<code>80</code>
<name>stopped</name>
</previousState>
</item>
</instancesSet>
</StartInstancesResponse>