Skip to content

Files

Latest commit

author
Cynthia Nottingham
Aug 10, 2018
8f2a601 · Aug 10, 2018

History

History
288 lines (254 loc) · 6.58 KB

virtual-machines-common-states-lifecycle.md

File metadata and controls

288 lines (254 loc) · 6.58 KB
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.

Power states

The power state represents the last known state of the VM.

VM power state diagram


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": [
{
"code": "PowerState/starting",
"level": "Info",
"displayStatus": "VM starting"
}
]

Not billed

Running

Normal working state for a VM

"statuses": [
{
"code": "PowerState/running",
"level": "Info",
"displayStatus": "VM running"
}
]

Billed

Stopping

This is a transitional state. When completed, it will show as **Stopped**.

"statuses": [
{
"code": "PowerState/stopping",
"level": "Info",
"displayStatus": "VM stopping"
}
]

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": [
{
"code": "PowerState/stopped",
"level": "Info",
"displayStatus": "VM stopped"
}
]

Not billed*

Deallocating

Transitional state. When completed, the VM will show as **Deallocated**.

"statuses": [
{
"code": "PowerState/deallocating",
"level": "Info",
"displayStatus": "VM deallocating"
}
]

Not billed*

Deallocated

The VM has been stopped successfully and removed from the host.

"statuses": [
{
"code": "PowerState/deallocated",
"level": "Info",
"displayStatus": "VM deallocated"
}
]

Not billed

*Some Azure resources, such as Disks and Networking, incur charges regardless of the instance's state.

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.

Here are the transitional operation states after the platform has accepted a user-initiated action:


States

Description

Creating

"statuses": [
{
"code": "ProvisioningState/creating",
"level": "Info",
"displayStatus": "Creating"
}

Updating

"statuses": [
{
"code": "ProvisioningState/updating",
"level": "Info",
"displayStatus": "Updating"
}
]

Deleting

"statuses": [
{
"code": "ProvisioningState/deleting",
"level": "Info",
"displayStatus": "Deleting"
}
]

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.

"statuses": [
{
"code": "ProvisioningState/creating/OSProvisioningInprogress",
"level": "Info",
"displayStatus": "OS Provisioning 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.
"statuses": [
{
"code": "ProvisioningState/creating/OSProvisioningComplete",
"level": "Info",
"displayStatus": "OS Provisioning Complete"
}
]

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" } ] ```

VM instance view

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.