title | description | services | author | ms.service | ms.topic | ms.date | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|
include file |
include file |
virtual-machines |
shandilvarun |
virtual-machines |
include |
08/09/2018 |
vashan, cynthn, rajsqr |
include file |
Azure Virtual Machines (VMs) go through different states that can be categorized into provisioning and power states. The purpose of this article is to describe these states and specifically highlight when customers are billed for instance usage.
The power state represents the last known state of the VM.
The following table provides a description of each instance state and indicates whether it is billed for instance usage or not.
State | Description | Instance usage billing |
---|---|---|
Starting |
VM is starting up. "statuses": [ |
Not billed |
Running |
Normal working state for a VM "statuses": [ |
Billed |
Stopping |
This is a transitional state. When completed, it will show as **Stopped**. "statuses": [ |
Billed |
Stopped |
The VM has been shut down from within the guest OS or using the PowerOff APIs. Hardware is still allocated to the VM and it remains on the host. "statuses": [ |
Not billed* |
Deallocating |
Transitional state. When completed, the VM will show as **Deallocated**. "statuses": [ |
Not billed* |
Deallocated |
The VM has been stopped successfully and removed from the host. "statuses": [ |
Not billed |
*Some Azure resources, such as Disks and Networking, incur charges regardless of the instance's state.
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.
Here are the transitional operation states after the platform has accepted a user-initiated action:
States |
Description |
Creating |
"statuses": [ |
Updating |
"statuses": [ |
Deleting |
"statuses": [ |
OS provisioning states |
If a VM is created with an OS image and not with a specialized image, then following substates can be observed: 1. OSProvisioningInprogress – The VM is running, and installation of guest OS is in progress.
2. OSProvisioningComplete – Short-lived state. The VM quickly transitions to **Success** unless any extensions need to be installed. Installing extensions can take time. Note: OS Provisioning can transition to **Failed** if there is an OS failure or the OS doesn't install in time. Customers will be billed for the deployed VM on the infrastructure. |
Once the operation is complete, the VM will transition into one of the following states:
-
Succeeded – the user-initiated actions have completed.
"statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "time": "time" } ] ```
-
Failed – represents a failed operation. Refer to the error codes to get more information and possible solutions.
"statuses": [ { "code": "ProvisioningState/failed/InternalOperationError", "level": "Error", "displayStatus": "Provisioning failed", "message": "Operation abandoned due to internal error. Please try again later.", "time": "time" } ] ```
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] (https://resources.azure.com/).
Provisioning states are visible on VM properties and instance view. Power states are available in instance view of VM.