Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

VM Lifecycle

Every VM in vmctl moves through a set of well-defined states.

States

StateDescription
PreparingBackend is allocating resources (overlay, ISO, sockets)
PreparedResources allocated, ready to boot
RunningVM is booted and executing
StoppedVM has been shut down (gracefully or forcibly)
FailedAn error occurred during a lifecycle operation
DestroyedVM and all its resources have been cleaned up

Transitions

          prepare()         start()
[new] ──────────> Prepared ──────────> Running
                                        │  │
                            suspend()   │  │  stop(timeout)
                           ┌────────────┘  └──────────────┐
                           v                               v
                        Suspended ─── resume() ──>     Stopped
                                                        │
                                           start()      │
                                     Running <──────────┘

Any state ── destroy() ──> Destroyed

Commands and Transitions

CommandFrom StateTo State
vmctl create(none)Prepared
vmctl startPrepared, StoppedRunning
vmctl stopRunningStopped
vmctl suspendRunningSuspended (paused vCPUs)
vmctl resumeSuspendedRunning
vmctl destroyAnyDestroyed
vmctl up(none), StoppedRunning (auto-creates if needed)
vmctl downRunningStopped
vmctl reloadAnyRunning (destroys + recreates)

Graceful Shutdown

vmctl stop sends an ACPI power-down signal via QMP. If the guest doesn't shut down within the timeout (default 30 seconds), vmctl sends SIGTERM, and finally SIGKILL as a last resort.