StopInstances
Description
Stops an instance that uses an Amazon EBS volume as its root device.
Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When an instance is stopped, the compute resources are released and you are not billed for hourly instance usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.
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. |
Request Parameters
Name | Description | Required |
---|---|---|
| The instance ID. Type: String Default: None | Yes |
| Forces the instance to stop. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. Type: Boolean Default: None | No |
Response Elements
Name | Description |
---|---|
|
Type: |
Ancestor: None
Children: requestId
, instancesSet
requestId
The ID of the request.
Type: xsd:string
Ancestor: StopInstancesResponseType
Children: None
instancesSet
Instances set.
Type: InstanceStateChangeSetType
Ancestor: StopInstancesResponseType
Children: item
item
The item element.
Type: InstanceStateChangeType
Ancestor: instancesSet
Children: instanceId
, currentState
, and previousState
instanceId
The instance ID.
Type: xsd:string
Ancestor: item
Children: None
currentState
The current state of the instance.
Type: InstanceStateType
Ancestor: item
Children: code
, name
code
A 16-bit unsigned integer. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented:
Type: xsd:int
Valid Values: 0 (pending)
| 16 (running)
| 32 (shutting-down)
| 48 (terminated)
| 64 (stopping)
| 80 (stopped)
Ancestor: currentState
Children: None
name
The current state of the instance.
Type: xsd:string
Valid Values: pending
| running
| shutting-down
| terminated
| stopping
| stopped
Ancestor: currentState
Children: None
previousState
The previous state of the instance.
Type: InstanceStateType
Ancestor: item
Children: code
, name
code
A 16-bit unsigned integer. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented:
Type: xsd:int
Valid Values: 0 (pending)
| 16 (running)
| 32 (shutting-down)
| 48 (terminated)
| 64 (stopping)
| 80 (stopped)
Ancestor: previousState
Children: None
name
The current state of the instance.
Type: xsd:string
Valid Values: pending
| running
| shutting-down
| terminated
| stopping
| stopped
Ancestor: previousState
Children: None
Examples
Example Request
This example stops the i-10a64379 instance.
https://ec2.amazonaws.com/?Action=StopInstances&InstanceId.1=i-10a64379&Force=false"&AuthParams
Example Response
<StopInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/"> <instancesSet> <item> <instanceId>i-10a64379</instanceId> <currentState> <code>64</code> <name>stopping</name> </currentState> <previousState> <code>16</code> <name>running</name> </previousState> </instancesSet> </StopInstancesResponse>