How to Start and Stop Instances
This section describes how to start and stop instances that use Amazon EBS volumes as their root devices.
When an instance is stopped, it is saved as a snapshot, and you are not billed for hourly usage or data transfer. You can then start it at any time by using the start operation.
Note | |
---|---|
Before stopping an instance, make sure it is in a state from which it can be restarted. Stopping an instance does not preserve data stored in RAM. Performing this operation on an instance that uses an instance store as its root device returns an error. When you start a stopped instance, the IP address is likely to change. By default, the Ec2ConfigService service (Windows) changes the instance hostname to match the new IP and initiates a reboot. |
How To
To stop an instance
-
If you are using SOAP, construct the following request:
<StopInstances xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <instanceId>i-10a64379</instanceId> </StopInstances>
-
If you are using Query, construct the following request:
https://ec2.amazonaws.com/ ?Action=StopInstances &InstanceId=i-10a64379 &...auth parameters...
-
View output similar to the following:
<StopInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <instanceId>i-10a64379</instanceId> </StopInstancesResponse>
To start an instance
-
If you are using SOAP, construct the following request:
<StartInstances xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <instanceId>i-10a64379</instanceId> </StartInstances>
-
If you are using Query, construct the following request:
https://ec2.amazonaws.com/ ?Action=StartInstances &InstanceId=i-10a64379 &...auth parameters...
-
View output similar to the following:
<StartInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <instanceId>i-10a64379</instanceId> </StartInstancesResponse>