Virtual machine lifecycle
A virtual machine is a stateful resource. How it moves between running, stopped, and suspended
depends on the engine it runs on. On qibdo’s own engine, the platform manages the full
lifecycle described below. On AWS, GCP, and Azure, a VM follows that provider’s native lifecycle.
stateDiagram-v2 classDef primary fill:#e8e8ff,stroke:#1100ff,stroke-width:2px,color:#0e0d1a classDef danger fill:#ffe3e8,stroke:#ff002f,stroke-width:2px,color:#0e0d1a [*] --> Running: create Running --> Stopped: stop Stopped --> Running: start Running --> Suspended: suspend Suspended --> Running: resume Running --> Running: restart / reset Running --> Deleted: delete Stopped --> Deleted: delete Suspended --> Deleted: delete Deleted --> [*] class Running,Stopped,Suspended primary class Deleted danger
Lifecycle states
Section titled “Lifecycle states”A VM reports its current state at any moment. Resting states are stable: a VM stays there until you ask for a change. Transient states are the brief in-between stages the platform reports while a change is in progress.
| State | Kind | What it means |
|---|---|---|
| Running | Resting | The VM is running. |
| Stopped | Resting | The VM is stopped but still exists. |
| Suspended | Resting | The VM’s state is saved to storage and can be resumed later. |
| Deleted | Terminal | The VM has been removed. |
| Scheduling | Transient | Placement is being decided. |
| Creating | Transient | The VM is being created. |
| Starting | Transient | Booting toward Running. |
| Stopping | Transient | Shutting down cleanly toward Stopped. |
| Suspending | Transient | Saving state toward Suspended. |
| Resuming | Transient | Restoring from Suspended toward Running. |
| Restarting | Transient | A graceful guest-OS reboot, from Running back to Running. |
| Resetting | Transient | A hard power cycle with no graceful shutdown, from Running back to Running. |
| Repairing | Transient | The platform is recovering the VM. |
Restart reboots the guest operating system gracefully; Reset forces a hard power cycle, the equivalent of pressing the reset button on a physical machine. Choose Reset only when a guest is unresponsive.
Tracking a change
Section titled “Tracking a change”Every lifecycle action is asynchronous. Instead of returning the VM, an action returns an operation you can follow. The operation reports its type, a status (pending, running, done, or error), a completion percentage, and any errors or warnings. Poll the operation until it is done or error: a done operation means the VM reached the target state, and a failed one leaves the VM in its previous state and explains why.
Each action also has a precondition on the current state. You start a stopped VM, resume a suspended one, and stop, suspend, restart, or reset a running one. An action whose precondition is not met fails the operation and leaves the VM unchanged.
On AWS, a VM follows Amazon EC2’s instance lifecycle. See the Amazon EC2 instance lifecycle.
On GCP, a VM follows Compute Engine’s instance lifecycle. See the Compute Engine instance lifecycle.
On Azure, a VM follows the Azure virtual-machine provisioning and power states. See States and billing for Azure Virtual Machines.