# Manage your customers' instances

> See the Cloud Compute instances your customers run, and start, stop, reboot or inspect one for them.

Source: https://www.coritan.com/docs/organizations/compute/

In the dashboard:

- /dashboard/organizations/…/compute: https://www.coritan.com/dashboard/organizations

The **Cloud Compute** tab lists the Cloud Compute instances behind your organization's services, with their power state as it is now. Owners and admins can start, reboot and stop them from the tab. The API adds rebuilds, snapshots, backups, rescue mode, the console and password resets. Your customers manage their own instances from your storefront, as [Let customers run Cloud Compute instances](/docs/organizations/storefront/portal-cloud-compute/) describes.

## Before you begin

- Every member can see the tab. Power actions, and every change through the API, need the owner or admin role.
- An instance appears once a customer orders one of your products that is linked to Cloud Compute. [Set up products and pricing](/docs/organizations/products-and-pricing/) explains linked products.

## Read the fleet

The cards at the top count your **Instances** and how many are running, and add up their **vCPU**, **Memory** and **Storage**. The table shows for each instance:

- **Instance**: its hostname, IP address, operating system and location.
- **Power**: whether it is running or stopped, and how long it has been up. The state updates by itself while the page is open.
- **Service**: the status of the service it belongs to.
- **Size**: its vCPU, memory and disk.
- **Created**: when it was created.

Select **Refresh** at the top of the table to load everything again.

## Start, reboot or stop an instance

1. In the [dashboard](https://www.coritan.com/dashboard/organizations), open the organization, then **Cloud Compute**.
2. When the instance is stopped, select **Start** in its row.
3. When it is running, open **Power** in its row and choose an action, then confirm it:
   - **Reboot** asks the operating system to restart. Anything unsaved inside it is lost.
   - **Shut down** asks the operating system to power off cleanly.
   - **Force stop** cuts the power at once, like pulling the plug. Use it only when the instance does not respond to **Shut down**.

The row shows the new state a moment later. Power controls are off while the service is suspended or the instance is moving to another host.

## Troubleshooting

"Instance is suspended"
: The service is suspended. [Unsuspend it](/docs/organizations/customer-services/) first.

"Instance is migrating"
: Coritan is moving the instance to another host. Try again when it has finished.

"Cloud Compute instance not found"
: The instance does not belong to one of your organization's services, or it has been terminated.

No instances yet
: No customer has ordered a product linked to Cloud Compute.

## Related

- [Manage customer services](/docs/organizations/customer-services/)
- [Let customers run Cloud Compute instances](/docs/organizations/storefront/portal-cloud-compute/)
- [Cloud Compute](/docs/cloud-compute/)

## With the API

Reads take any member's access token; changes take the owner or admin role. `{uuid}` is the instance's `uuid` from the list.

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

Start, reboot or stop an instance. `action` is `start`, `reboot`, `shutdown` or `stop` (force stop):

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

Read an instance (the paths are under `/api/v1/orgs/acme/vps`):

| Operation | What it returns |
| --- | --- |
| `GET /templates` | The operating system templates you can rebuild onto, with their `id`, `name`, `os_family`, `os_version`, `default_username` and minimum size. |
| `GET /{uuid}` | The instance, with its template name and default username, and any move in progress as `migration`. |
| `GET /{uuid}/status` | Its power state now, with its uptime and usage. |
| `GET /{uuid}/config` | Its configuration, without secrets. |
| `GET /{uuid}/guest` | What the operating system reports about itself. |
| `GET /{uuid}/graphs` | Usage over `timeframe`: `hour` (the default), `day`, `week`, `month` or `year`. |
| `GET /{uuid}/bandwidth` | Its traffic use. |
| `GET /{uuid}/ips` | Its IP addresses. |
| `GET /{uuid}/console` | A session for its browser console. |
| `GET /{uuid}/snapshots` | Its snapshots. |
| `GET /{uuid}/backups` | Its backups. |
| `GET /{uuid}/rescue/media` | The rescue images you can boot it from, each with a `volid`. |

Change an instance (owner or admin):

| Operation | Body | What it does |
| --- | --- | --- |
| `POST /{uuid}/rebuild` | `template_id` | Reinstalls the instance from a template. This erases its disk and sets a new password; get one with a password reset. |
| `POST /{uuid}/reset-password` | none | Sets a new password and returns it as `password`. |
| `PATCH /{uuid}/hostname` | `hostname`, `reboot` | Renames it. With `reboot` set to `true`, a running instance restarts to use the name. |
| `PUT /{uuid}/ssh-keys` | `ssh_keys` | Replaces its SSH public keys, one per line. An empty string removes them all. |
| `POST /{uuid}/cloud-init/regenerate` | none | Applies its user, password, hostname and network settings again at boot. |
| `POST /{uuid}/snapshots` | `name`, `description`, `vmstate` | Takes a snapshot. `name` starts with a letter and has up to 40 letters, digits, hyphens or underscores. `vmstate` set to `true` saves the memory too. An instance holds up to 8 snapshots. |
| `POST /{uuid}/snapshots/{snapshot_id}/rollback` | none | Returns the instance to a snapshot. |
| `DELETE /{uuid}/snapshots/{snapshot_id}` | none | Deletes a snapshot. |
| `POST /{uuid}/backups` | `note`, `mode` | Starts a backup. `mode` is `snapshot` (the default), `suspend` or `stop`. |
| `POST /{uuid}/backups/{backup_id}/restore` | none | Restores a backup over the instance. |
| `DELETE /{uuid}/backups/{backup_id}` | none | Deletes a backup. |
| `POST /{uuid}/rescue/enter` | `iso_volid` | Boots the instance from a rescue image. |
| `POST /{uuid}/rescue/exit` | none | Takes the rescue image out and restarts the instance from its own disk. |

A suspended instance answers `403` with "Instance is suspended" to most changes, and an instance on the move answers `409` with "Instance is migrating". One backup or restore runs at a time; another answers `409`.

## API

- `GET /api/v1/orgs/{org_slug}/vps`: Org list instances (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps)
- `GET /api/v1/orgs/{org_slug}/vps/templates`: Org list templates (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-templates)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}`: Org get instance (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/backups`: Org list backups (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-backups)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/backups`: Org create backup (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-backups)
- `DELETE /api/v1/orgs/{org_slug}/vps/{uuid}/backups/{backup_id}`: Org delete backup (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-delete-api-v1-orgs-org-slug-vps-uuid-backups-backup-id)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/backups/{backup_id}/restore`: Org restore backup (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-backups-backup-id-restore)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/bandwidth`: Org bandwidth (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-bandwidth)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/cloud-init/regenerate`: Org regenerate cloud init (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-cloud-init-regenerate)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/config`: Org config (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-config)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/console`: Org console (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-console)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/graphs`: Org graphs (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-graphs)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/guest`: Org guest (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-guest)
- `PATCH /api/v1/orgs/{org_slug}/vps/{uuid}/hostname`: Org hostname (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-patch-api-v1-orgs-org-slug-vps-uuid-hostname)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/ips`: Org IPs (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-ips)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/power`: Org power (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-power)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/rebuild`: Org rebuild (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-rebuild)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/rescue/enter`: Org rescue enter (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-rescue-enter)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/rescue/exit`: Org rescue exit (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-rescue-exit)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/rescue/media`: Org rescue media (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-rescue-media)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/reset-password`: Org reset password (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-reset-password)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/snapshots`: Org list snapshots (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-snapshots)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/snapshots`: Org create snapshot (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-snapshots)
- `DELETE /api/v1/orgs/{org_slug}/vps/{uuid}/snapshots/{snapshot_id}`: Org delete snapshot (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-delete-api-v1-orgs-org-slug-vps-uuid-snapshots-snapshot-id)
- `POST /api/v1/orgs/{org_slug}/vps/{uuid}/snapshots/{snapshot_id}/rollback`: Org rollback snapshot (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-post-api-v1-orgs-org-slug-vps-uuid-snapshots-snapshot-id-rollback)
- `PUT /api/v1/orgs/{org_slug}/vps/{uuid}/ssh-keys`: Org SSH keys (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-put-api-v1-orgs-org-slug-vps-uuid-ssh-keys)
- `GET /api/v1/orgs/{org_slug}/vps/{uuid}/status`: Org status (https://www.coritan.com/docs/api/reference/organizations/org-cloud-compute/#op-get-api-v1-orgs-org-slug-vps-uuid-status)
