Instance States¶
Every instance has a state that reflects what it is currently doing. You can see the current state in the instance list and on the instance detail view. The state also governs which Actions are available at any given time.
Normal Lifecycle¶
In normal operation an instance is Healthy. Changing its configuration marks it Pending Update until you apply the change with Update; Update, Restart, and Recover each return it to Healthy when they finish, and Destroy is terminal.
A Destroy with a final Snapshot (the default) first shows Snapshot Creating (Pending Destroy), then Destroying. Running Recover while the final Snapshot runs cancels the destroy. Once the instance is gone, its remaining cloud resources are cleaned up in the background.
stateDiagram-v2
direction TB
state "Pending Update" as PendingUpdate
state "Building Image" as BuildingImage
state update_choice <<choice>>
[*] --> Creating: Create
Creating --> Healthy
Healthy --> PendingUpdate: on configuration change
PendingUpdate --> update_choice: Update
update_choice --> BuildingImage: requires a new image
update_choice --> Updating
BuildingImage --> Updating: build succeeds
BuildingImage --> PendingUpdate: build fails
Updating --> Healthy
Healthy --> Restarting: Restart
Restarting --> Healthy
Healthy --> Recovering: Recover
Recovering --> Healthy
state "Snapshot Creating (Pending Destroy)" as PendingDestroy
Healthy --> PendingDestroy: Destroy with final Snapshot
PendingDestroy --> Destroying: Snapshot succeeds
PendingDestroy --> Healthy: Recover, or the Snapshot fails
Healthy --> Destroying: Destroy without final Snapshot
Destroying --> [*]
Cloning¶
A new clone moves through these states (see Clone an Instance):
| State | What is happening |
|---|---|
| Creating (Waiting for Snapshot) | A Snapshot of the source is being taken; the source shows Snapshot Creating. Destroying the clone now removes it right away. |
| Creating | The clone's instance is built with an empty database. |
| Snapshot Restoring | The Snapshot is restored into the clone, and the source's uploaded files are copied. |
| Healthy | The clone is ready. |
A clone from an existing Snapshot starts at Creating, and a clone without data ends after Creating.
Error Handling¶
If an operation fails, the instance enters Errored. From there you can correct the change and Update to retry, Recover to redeploy the last known-good image, or Destroy the instance.
stateDiagram-v2
direction LR
[*] --> Errored: an operation fails
Errored --> Updating: Update
Updating --> Healthy
Errored --> Recovering: Recover
Recovering --> Healthy
Errored --> Destroying: Destroy
Destroying --> [*]