Skip to content

StartInstances, StopInstances, RebootInstances

Three actions that change whether an instance is running. They differ in what survives, what is charged, and whether the instance may move to another machine.

ActionResource scopeARN shape
ec2:StartInstancesResource-scopedinstance/<id>
ec2:StopInstancesResource-scopedinstance/<id>
ec2:RebootInstancesResource-scopedinstance/<id>

Shuts the operating system down and releases CPU and memory. The root volume is kept.

ParameterTypeRequiredNotes
InstanceId.NlistYes
ForcebooleanNoStop without a clean shutdown
DryRunbooleanNo

Force skips the guest shutdown. It is the equivalent of removing power, and it risks filesystem corruption in the same way. Use it when a guest has stopped responding, not as a default.

Response: instancesSet, each with instanceId, previousState and currentState.

<StopInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
<requestId>b1e2c3d4-5678-90ab-cdef-1234567890ab</requestId>
<instancesSet>
<item>
<instanceId>i-0a1b2c3d4e5f60718</instanceId>
<currentState><code>64</code><name>stopping</name></currentState>
<previousState><code>16</code><name>running</name></previousState>
</item>
</instancesSet>
</StopInstancesResponse>

Billing: rating counts a running instance, by its shape, per hour — so the charge ends when the instance leaves running.

Its root disk is not billed separately, because storage is not rated at all today. It does still occupy the pool, so a stopped instance costs you nothing and costs the platform capacity. See Billing user guide.

The public address is not retained. A stopped instance that is started again may receive a different address.

Stopping an already-stopped instance succeeds and reports its current state.

Starts a stopped instance.

ParameterTypeRequired
InstanceId.NlistYes
DryRunbooleanNo

The instance returns to pending, then running. It may be placed on a different physical machine, which is why a start can fail for capacity when the original launch did not.

Errors

CodeStatusCause
IncorrectInstanceState400The instance is not stopped
InsufficientInstanceCapacity500No capacity for that type now
InvalidInstanceID.NotFound400No such instance

InsufficientInstanceCapacity on a start is worth calling out: an instance you stopped is not capacity held for you. Stopping releases it, and starting competes for it again.

Restarts the guest operating system in place.

ParameterTypeRequired
InstanceId.NlistYes
DryRunbooleanNo

The instance does not leave running, does not change machine, keeps its address, and continues to be charged. The response carries no instance state, only a request id and return.

A reboot is not a stop-then-start, and cannot be used to move an instance to a different machine or to change its address.

You want toUse
Restart the OSRebootInstances
Stop paying for compute, keep the diskStopInstances
Stop paying entirely, lose the diskTerminateInstances
Move to another machineStop, then start