Skip to main content

States and Statuses of Virtual Machines

During its provisioning and lifecycle, a virtual machine progresses through various states, each associated with distinct statuses. The Infrahub API utilizes several properties to describe these states, offering a clear and constant insight into the virtual machine's condition.


Status Property

The status property indicates the operational state of a virtual machine, offering details on its current condition and availability.


Operations and Corresponding Statuses

Below, you will find a detailed breakdown of the various virtual machine operations and their associated statuses at various points in a VM's lifecycle:

Create operation

Create a VM: POST /core/virtual-machines
StatusDescription
CREATINGInfrahub has accepted the request to create the VM.
BUILDThe VM is being built with the provided configuration.
ACTIVEThe VM is now running and ready for use.
ERRORThis status appears if the VM build stage encounters a failure.

Stop Operation

Stop a VM: GET /core/virtual-machines/{id}/stop
StatusDescription
STOPPINGInfrahub has accepted the request to stop the VM.
SHUTOFFThe VM has been successfully shut down.

Start/Hard Reboot Operations

Start a VM: GET /core/virtual-machines/{id}/start
Hard reboot a VM: GET /core/virtual-machines/{id}/hard-reboot
StatusDescription
STARTINGInfrahub has accepted the request to start the VM.
REBOOTINGInfrahub has accepted the request to perform a hard reboot on the VM, simulating the process of unplugging and rebooting a physical machine.
ACTIVEThe VM is now running.

Hibernate/Restore Operations

Hibernate a VM: GET /core/virtual-machines/{virtual_machine_id}/hibernate
Restore VM from hibernation: GET /core/virtual-machines/{virtual_machine_id}/hibernate-restore
StatusDescription
HIBERNATINGInfrahub has accepted the request to hibernate the VM.
HIBERNATEDThe VM is now hibernated.
RESTORINGInfrahub has accepted the request to wake up the VM and restore it from hibernation.
ACTIVEThe VM is now awake and running.

Attach/detach Public IP Operations

Attach a public IP: POST /core/virtual-machines/{id}/attach-floatingip
Detach a public IP: POST /core/virtual-machines/{id}/detach-floatingip
StatusDescription
ATTACHINGInfrahub has accepted the request to attach a public IP to the VM.
DETACHINGInfrahub has accepted the request to detach a public IP from the VM.
ATTACHEDThe public IP has been successfully attached to the VM.
NO PUBLIC IPThe public IP has been detached from the VM.

Attach/detach security rules operations

Add a security rule: POST /core/virtual-machines/{id}/sg-rules
StatusDescription
PENDINGInfrahub has accepted the request to create a security rule.
DELETINGInfrahub has accepted the request to delete a security rule.
SUCCESSThe security rule has been created or deleted, depending on the operation called.
ERRORInfrahub failed to create or delete the security rule.

Task states

In virtual machine management, task states are similar to VM states and often use the "-ing" suffix to indicate ongoing tasks related to VM operations. Here are some examples of task states:

TaskDescription
NoneNo task is currently in progress.
BUILDINGThe VM is being initialized.
DELETINGThe VM is currently in the process of being deleted.
STOPPINGThe VM is currently shutting down.
STARTINGThe VM is booting up.
REBOOTINGThe VM is in the process of rebooting.
BLOCK_DEVICE_MAPPINGThe VM is mapping block devices such as local disks and volumes.
SPAWNINGThe VM is being assigned to a proper host.
HIBERNATINGThe VM is in the process of being hibernated.

Examples of power state

Power states refer to the operational conditions of a virtual machine (VM), indicating its current status. Below are the different power states that a VM can exhibit:

Power StateDescription
NOSTATEThe VM is yet to be scheduled.
RUNNINGThe VM is active and running.
PAUSEDThe VM is paused.
SHUTDOWNThe VM is in a shutdown state.
CRASHEDThe VM has crashed.
SUSPENDEDThe VM has been suspended.

Other useful properties

  • vm_state: Describes the VM's current stable state when no ongoing API call to Infrahub is in progress. It reflects the expected state of the VM from the customer's perspective.

  • task_state: Represents a transition state associated with ongoing Infrahub API calls. This state specifies the task the VM is currently executing.

  • power_state: Refers to the hypervisor state of the VM, indicating its power status.


Back to top