This article discusses the Azure VM power states and provisioning states.
- Starting: The VM is being started.
- Running: The VM is running.
- Stopping: The VM is being stopped.
- Stopped: The VM is stopped. Note that VMs in the stopped state still incur compute charges.
- Deallocating: The VM is being deallocated.
- Deallocated: The VM is completely removed from the hypervisor but still available in the control plane. VMs in the deallocated state do not incur compute charges.
- Unknown (
-): The power state of the VM is unknown.
A common confusion comes in when comparing the power status of stopped vs stopped (deallocated). A good explanation of the difference between the two is provided in the following Microsoft article: https://docs.microsoft.com/en-us/archive/blogs/gbanin/difference-between-the-states-of-azure-virtual-machines-stopped-and-stopped-deallocated
Azure VMs also have provisioning states. A 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.
- Create – VM creation.
- Update – updates the model for an existing VM. Some non-model changes to VM such as Start/Restart also fall under update.
- Delete – VM deletion.
- Deallocate – is where a VM is stopped and removed from the host. Deallocating a VM is considered an update, so it will display provisioning states related to updating.
How to view the power states and provisioning states
The instance view API provides VM running-state information. For more information, see the Virtual Machines – Instance View API documentation. Azure Resources explorer provides a simple UI for viewing the VM running state: Resource Explorer. Provisioning states are visible on VM properties and instance view. Power states are available in instance view of VM.
To retrieve the state of a virtual machine by Powershell, the below cmdlet can be used:
Get-AzureRmVM -ResourceGroupName "TestResourceGroupName" -Name "VMName" -Status