States and billing status of Azure Virtual Machines
Applies to: ✔️ Linux VMs ✔️ Windows VMs ✔️ Flexible scale sets ✔️ Uniform scale sets
Azure Virtual Machines (VM) instances go through different states. There are provisioning and power states. This article describes these states and highlights when customers are billed for instance usage.
Get states using Instance View
The instance view API provides VM running-state information. For more information, see Virtual Machines - Instance View.
Azure Resources Explorer provides a simple UI for viewing the VM running state: Resource Explorer.
The VM provisioning state is available, in slightly different forms, from within the VM properties
provisioningState and the InstanceView. In the VM InstanceView, there's an element within the
status array in the form of
To retrieve the power state of all the VMs in your subscription, use the Virtual Machines - List All API with parameter
statusOnly set to
Virtual Machines - List All API with parameter
statusOnly set to
true retrieves the power states of all VMs in a subscription. However, in some rare situations, the power state may not available due to intermittent issues in the retrieval process. In such situations, we recommend retrying using the same API or using Azure Resource Health to check the power state of your VMs.
Power states and billing
The power state represents the last known state of the VM.
The following table provides a description of each instance state and indicates whether that state is billed for instance usage.
|Virtual machine is allocating resources.
|Virtual machine is powering up.
|Virtual machine is fully up. This state is the standard working state.
|This state is transitional between running and stopped.
|The virtual machine is allocated on a host but not running. Also called PoweredOff state or Stopped (Allocated). This state can be result of invoking the
PowerOff API operation or invoking shutdown from within the guest OS. The Stopped state might also be observed briefly during VM creation or while starting a VM from Stopped (Deallocated) state.
|This state is transitional between Running and Deallocated.
|The virtual machine has released the lease on the underlying hardware. If the machine is powered off it is shown as Stopped (Deallocated). If it has entered hibernation it is shown as Hibernated (Deallocated)
Example of PowerState in JSON:
"displayStatus": "VM running"
The provisioning state is the status of a user-initiated, control-plane operation on the VM. These states are separate from the power state of a VM.
|Virtual machine is being created.
|Virtual machine is updating to the latest model. Some non-model changes to a virtual machine such as start and restart fall under the updating state.
|Last operation on the virtual machine resource was unsuccessful.
|Last operation on the virtual machine resource was successful.
|Virtual machine is being deleted.
|Seen when migrating from Azure Service Manager to Azure Resource Manager.
OS Provisioning states
OS Provisioning states only apply to virtual machines created with a generalized OS image. Specialized images and disks attached as OS disk don't display these states. The OS provisioning state isn't shown separately. It's a substate of the Provisioning State in the VM InstanceView. For example,
|OS Provisioning state
|The VM is running and the initialization (setup) of the Guest OS is in progress.
|This state is a short-lived state. The virtual machine quickly transitions from this state to Success. If extensions are still being installed, you continue to see this state until installation is complete.
|The user-initiated actions have completed.
|Represents a failed operation. For more information and possible solutions, see the error code.
Troubleshooting VM states
To troubleshoot hibernation, see Troubleshoot VM hibernation.
For other troubleshooting help visit Azure Virtual Machines troubleshooting documentation.