# Start, stop and restart an instance

> Use the power controls to start, restart, shut down or force off an instance, and read its power state.

Source: https://www.coritan.com/docs/cloud-compute/power/

The power buttons in an instance's header start it, restart it and shut it down, as the power button on a physical machine would. Use them when the instance does not answer, after you change its settings, or to stop it while you do not need it.

Stopping an instance does not stop its billing. A stopped instance keeps its disk, addresses and plan, and you pay for it until you [cancel it](/docs/cloud-compute/billing/).

## Before you begin

- The instance is not suspended. A suspended instance shows **This instance is suspended** and no power buttons; select **Open Billing** to see why and settle it.

## Use the power buttons

In the [dashboard](https://www.coritan.com/dashboard/compute), go to **Cloud Compute** and open the instance. The header shows the buttons that fit its state:

**Start**
: Shown when the instance is stopped. Boots it.

**Restart**
: Shown when it is running. Asks the operating system to shut down, then starts the instance again.

**Stop**
: Shown when it is running. Asks the operating system to shut down cleanly. If it has not stopped after 60 seconds, we power it off.

**Kill…**
: In the **Instance actions** menu beside the buttons, when the instance is running. Cuts the power at once.

A message confirms each action: `Starting.`, `Rebooting.`, `Shutting down.` or `Powering off.`. The status in the header changes a few seconds later.

> [!WARNING]
> **Kill…** gives the operating system no chance to shut down, and you lose anything it has not written to disk. Use **Stop** unless the instance ignores it.

To kill an instance, open the **Instance actions** menu, select **Kill…**, then select **Kill instance** in the dialog.

## Restart from the dashboard to apply changes

A restart from the header stops the virtual machine and starts it again, and the new start picks up changes to its configuration: SSH keys, hostname, network settings and the display. A `reboot` typed inside the instance restarts only the operating system, so those changes wait for the next start from the dashboard.

## Result

The header shows the new status: `running` with the time it has been up, or `stopped`. The **Cloud Compute** list shows the same status on the instance's card.

## Troubleshooting

**Stop** or **Restart** does nothing
: The operating system ignored the request to shut down. **Stop** powers the instance off after 60 seconds anyway. If a restart hangs, select **Kill…**, then **Start**.

`Cannot perform power actions on a suspended instance`
: The service behind the instance is suspended. Settle it from the **Billing** tab; [What happens when a payment fails](/docs/billing/failed-payments/) explains suspension.

`Instance is migrating`
: We are moving the instance to another host. Wait until the move finishes and try again.

`Too many requests for this action. Please wait and try again.`
: You sent more than 24 power actions for this instance in 60 seconds. Wait for the time the response gives in `Retry-After`.

## Related

- [Use an instance's console](/docs/cloud-compute/console/) to watch the instance boot.
- [Repair an instance in rescue mode](/docs/cloud-compute/rescue-mode/) when it does not boot.
- [Cloud Compute limits](/docs/cloud-compute/limits/) lists every rate limit.

## With the API

`POST /api/v1/client/vps/{uuid}/power` sends a power action. Send `action` as one of:

`start`
: Boot the instance.

`reboot`
: Shut the operating system down and start it again. The dashboard's **Restart**.

`shutdown`
: Shut down cleanly, and power off after 60 seconds if it has not stopped. The dashboard's **Stop**.

`stop`
: Power off at once. The dashboard's **Kill…**.

```bash
curl -X POST https://api.coritan.com/api/v1/client/vps/$INSTANCE_UUID/power \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "shutdown"}'
```

The request returns once the host has carried out the action, with `{"status": "ok", "action": "shutdown"}`. Any other word answers `400` with `Invalid action. Must be: start, stop, shutdown, reboot`. A suspended instance answers `403`, one we are moving answers `409`, and more than 24 actions in 60 seconds answer `429`, as [Rate limits](/docs/api/rate-limits/) describes.

`GET /api/v1/client/vps/{uuid}/status` reads the instance's live state from its host.

```bash
curl https://api.coritan.com/api/v1/client/vps/$INSTANCE_UUID/status \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

`status`
: `running` or `stopped` as the host reports it, or `migrating` while we move the instance.

`power_state`
: The machine's own state, such as `running`, `paused` or `stopped`.

`cpu`
: CPU use as a fraction of the instance's vCPUs, from `0` to `1`.

`mem`, `maxmem`
: Memory in use and memory size, in bytes.

`disk`, `maxdisk`
: Disk in use and disk size, in bytes.

`netin`, `netout`
: Bytes received and sent since the instance last started.

`uptime`
: Seconds since the instance last started.

`agent_online`
: `true` when the QEMU guest agent inside the instance answered.

`instance_status`, `rescue_mode`, `migration`
: The instance's status on your account, whether it is booted into rescue media, and the move in progress, if any.

## API

- `POST /api/v1/client/vps/{uuid}/power`: Execute a power action on the VPS (https://www.coritan.com/docs/api/reference/client/cloud-compute/#op-post-api-v1-client-vps-uuid-power)
- `GET /api/v1/client/vps/{uuid}/status`: Get real-time VM status from Proxmox (enriched) (https://www.coritan.com/docs/api/reference/client/cloud-compute/#op-get-api-v1-client-vps-uuid-status)
