Stop, start or reboot an instance
Power an instance off, on again, shut it down cleanly or reboot it.
Replace i-3f9a2c07 with your instance's id. stop cuts the power; shutdown asks the guest OS
to halt cleanly; reboot restarts the machine.
Prerequisites
- In the console, also
ec2:DescribeInstancesto open the instance's page (without it the page is not found). - Permission for
ec2:StartInstances(start),ec2:StopInstances(stop and shutdown) orec2:RebootInstances(reboot). startneeds the instancestopped(orsuspended);stop,shutdownandrebootneed itrunning. Otherwise the request is refused with400"Cannot start instance in state: …" ("Cannot stop instance in state: …" forstopandshutdown, "Cannot reboot instance in state: …" forreboot). In the console the action is unavailable, with the reason, until the instance is in that state.- An instance that is a node of a Kubernetes cluster is refused with
409"This instance is node … of the Kubernetes cluster …. Scale or delete its node group instead." - An instance on your own hosts whose machine does not exist yet is refused with
409"Instance is not yet backed by a machine".
Change the power state
- Open the instance. The header shows Stop while it runs and Start while it is stopped.
- Choose Stop or Start, or open the ⋯ menu and choose Reboot.
- For Stop and Reboot, choose Stop or Reboot in the dialog that asks to confirm. Start asks nothing.
The console has no separate shutdown; its Stop cuts the power.
dcloud ec2 instances stop i-3f9a2c07
dcloud ec2 instances shutdown i-3f9a2c07
dcloud ec2 instances start i-3f9a2c07
dcloud ec2 instances reboot i-3f9a2c07PATCH /ec2/api/instances/i-3f9a2c07
{ "action": "reboot" }action is start, stop, shutdown or reboot.
Result
The answer comes at once with the transitional state (pending, stopping or rebooting); the
final state follows when the provider is done (running or stopped). If the action fails, the
instance returns to its previous state and the page shows the error. A stopped instance keeps its
disk, addresses and volumes. Instance hours are billed only while the instance is running, so a
stopped instance costs nothing per hour; its volumes are still billed, and its snapshots and
elastic IPs are still metered.
A machine of an auto scaling group that you stop here is replaced by the group.