Virtual Machines - Instance View

Retrieves information about the run-time state of a virtual machine.

HTTP
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView?api-version=2019-12-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

vmName
path True

string

The name of the virtual machine.

api-version
query True

string

Client Api Version.

Responses

Name Type Description
200 OK

VirtualMachineInstanceView

OK

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Get Virtual Machine Instance View.

Sample request

HTTP
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/instanceView?api-version=2019-12-01

Sample response

JSON
{
  "platformUpdateDomain": 1,
  "platformFaultDomain": 1,
  "computerName": "myVM",
  "osName": "Windows Server 2016 Datacenter",
  "osVersion": "Microsoft Windows NT 10.0.14393.0",
  "vmAgent": {
    "vmAgentVersion": "2.7.41491.949",
    "statuses": [
      {
        "code": "ProvisioningState/succeeded",
        "level": "Info",
        "displayStatus": "Ready",
        "message": "GuestAgent is running and accepting new configurations.",
        "time": "2019-10-14T23:11:22+00:00"
      }
    ],
    "extensionHandlers": [
      {
        "type": "Microsoft.Azure.Security.IaaSAntimalware",
        "typeHandlerVersion": "1.5.5.9",
        "status": {
          "code": "ProvisioningState/succeeded",
          "level": "Info",
          "displayStatus": "Ready"
        }
      }
    ]
  },
  "disks": [
    {
      "name": "myOsDisk",
      "statuses": [
        {
          "code": "ProvisioningState/succeeded",
          "level": "Info",
          "displayStatus": "Provisioning succeeded",
          "time": "2019-10-14T21:29:47.477089+00:00"
        }
      ]
    },
    {
      "name": "myDataDisk0",
      "statuses": [
        {
          "code": "ProvisioningState/succeeded",
          "level": "Info",
          "displayStatus": "Provisioning succeeded",
          "time": "2019-10-14T21:29:47.461517+00:00"
        }
      ]
    }
  ],
  "bootDiagnostics": {
    "consoleScreenshotBlobUri": "https://{myStorageAccount}.blob.core.windows.net/bootdiagnostics-myOsDisk/myOsDisk.screenshot.bmp",
    "serialConsoleLogBlobUri": "https://{myStorageAccount}.blob.core.windows.net/bootdiagnostics-myOsDisk/myOsDisk.serialconsole.log"
  },
  "extensions": [
    {
      "name": "IaaSAntiMalware-ext0",
      "type": "Microsoft.Azure.Security.IaaSAntimalware",
      "typeHandlerVersion": "1.5.5.9",
      "statuses": [
        {
          "code": "ProvisioningState/succeeded",
          "level": "Info",
          "displayStatus": "Provisioning succeeded",
          "message": "Microsoft Antimalware enabled"
        }
      ]
    }
  ],
  "hyperVGeneration": "V1",
  "statuses": [
    {
      "code": "ProvisioningState/succeeded",
      "level": "Info",
      "displayStatus": "Provisioning succeeded",
      "time": "2019-10-14T21:30:12.8051917+00:00"
    },
    {
      "code": "PowerState/running",
      "level": "Info",
      "displayStatus": "VM running"
    }
  ]
}

Definitions

Name Description
BootDiagnosticsInstanceView

Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor.

DiskEncryptionSettings

Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15

DiskInstanceView

The virtual machine disk information.

HyperVGenerationType

Specifies the HyperVGeneration Type associated with a resource

InstanceViewStatus

Instance view status.

KeyVaultKeyReference

Specifies the location of the key encryption key in Key Vault.

KeyVaultSecretReference

Specifies the location of the disk encryption key, which is a Key Vault Secret.

MaintenanceOperationResultCodeTypes

The Last Maintenance Operation Result Code.

MaintenanceRedeployStatus

The Maintenance Operation status on the virtual machine.

StatusLevelTypes

The level code.

SubResource

The relative URL of the Key Vault containing the secret.

VirtualMachineAgentInstanceView

The VM Agent running on the virtual machine.

VirtualMachineExtensionHandlerInstanceView

The virtual machine extension handler instance view.

VirtualMachineExtensionInstanceView

The extensions information.

VirtualMachineInstanceView

The instance view of a virtual machine.

BootDiagnosticsInstanceView

Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor.

Name Type Description
consoleScreenshotBlobUri

string

The console screenshot blob URI.

serialConsoleLogBlobUri

string

The Linux serial console log blob Uri.

status

InstanceViewStatus

The boot diagnostics status information for the VM.

NOTE: It will be set only if there are errors encountered in enabling boot diagnostics.

DiskEncryptionSettings

Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15

Name Type Description
diskEncryptionKey

KeyVaultSecretReference

Specifies the location of the disk encryption key, which is a Key Vault Secret.

enabled

boolean

Specifies whether disk encryption should be enabled on the virtual machine.

keyEncryptionKey

KeyVaultKeyReference

Specifies the location of the key encryption key in Key Vault.

DiskInstanceView

The virtual machine disk information.

Name Type Description
encryptionSettings

DiskEncryptionSettings[]

Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15

name

string

The disk name.

statuses

InstanceViewStatus[]

The resource status information.

HyperVGenerationType

Specifies the HyperVGeneration Type associated with a resource

Value Description
V1
V2

InstanceViewStatus

Instance view status.

Name Type Description
code

string

The status code.

displayStatus

string

The short localizable label for the status.

level

StatusLevelTypes

The level code.

message

string

The detailed status message, including for alerts and error messages.

time

string

The time of the status.

KeyVaultKeyReference

Specifies the location of the key encryption key in Key Vault.

Name Type Description
keyUrl

string

The URL referencing a key encryption key in Key Vault.

sourceVault

SubResource

The relative URL of the Key Vault containing the key.

KeyVaultSecretReference

Specifies the location of the disk encryption key, which is a Key Vault Secret.

Name Type Description
secretUrl

string

The URL referencing a secret in a Key Vault.

sourceVault

SubResource

The relative URL of the Key Vault containing the secret.

MaintenanceOperationResultCodeTypes

The Last Maintenance Operation Result Code.

Value Description
MaintenanceAborted
MaintenanceCompleted
None
RetryLater

MaintenanceRedeployStatus

The Maintenance Operation status on the virtual machine.

Name Type Description
isCustomerInitiatedMaintenanceAllowed

boolean

True, if customer is allowed to perform Maintenance.

lastOperationMessage

string

Message returned for the last Maintenance Operation.

lastOperationResultCode

MaintenanceOperationResultCodeTypes

The Last Maintenance Operation Result Code.

maintenanceWindowEndTime

string

End Time for the Maintenance Window.

maintenanceWindowStartTime

string

Start Time for the Maintenance Window.

preMaintenanceWindowEndTime

string

End Time for the Pre Maintenance Window.

preMaintenanceWindowStartTime

string

Start Time for the Pre Maintenance Window.

StatusLevelTypes

The level code.

Value Description
Error
Info
Warning

SubResource

The relative URL of the Key Vault containing the secret.

Name Type Description
id

string

Resource Id

VirtualMachineAgentInstanceView

The VM Agent running on the virtual machine.

Name Type Description
extensionHandlers

VirtualMachineExtensionHandlerInstanceView[]

The virtual machine extension handler instance view.

statuses

InstanceViewStatus[]

The resource status information.

vmAgentVersion

string

The VM Agent full version.

VirtualMachineExtensionHandlerInstanceView

The virtual machine extension handler instance view.

Name Type Description
status

InstanceViewStatus

The extension handler status.

type

string

Specifies the type of the extension; an example is "CustomScriptExtension".

typeHandlerVersion

string

Specifies the version of the script handler.

VirtualMachineExtensionInstanceView

The extensions information.

Name Type Description
name

string

The virtual machine extension name.

statuses

InstanceViewStatus[]

The resource status information.

substatuses

InstanceViewStatus[]

The resource status information.

type

string

Specifies the type of the extension; an example is "CustomScriptExtension".

typeHandlerVersion

string

Specifies the version of the script handler.

VirtualMachineInstanceView

The instance view of a virtual machine.

Name Type Description
bootDiagnostics

BootDiagnosticsInstanceView

Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor.

computerName

string

The computer name assigned to the virtual machine.

disks

DiskInstanceView[]

The virtual machine disk information.

extensions

VirtualMachineExtensionInstanceView[]

The extensions information.

hyperVGeneration

HyperVGenerationType

Specifies the HyperVGeneration Type associated with a resource

maintenanceRedeployStatus

MaintenanceRedeployStatus

The Maintenance Operation status on the virtual machine.

osName

string

The Operating System running on the virtual machine.

osVersion

string

The version of Operating System running on the virtual machine.

platformFaultDomain

integer

Specifies the fault domain of the virtual machine.

platformUpdateDomain

integer

Specifies the update domain of the virtual machine.

rdpThumbPrint

string

The Remote desktop certificate thumbprint.

statuses

InstanceViewStatus[]

The resource status information.

vmAgent

VirtualMachineAgentInstanceView

The VM Agent running on the virtual machine.