Virtual Machines - Instance View
Retrieves information about the run-time state of a virtual machine.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView?api-version=2024-07-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
vm
|
path | True |
string |
The name of the virtual machine. |
api-version
|
query | True |
string |
Client Api Version. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
Error response describing why the operation failed. |
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 instance view of a virtual machine placed on a dedicated host group through automatic placement. |
Get Virtual Machine Instance View. |
Get instance view of a virtual machine placed on a dedicated host group through automatic placement.
Sample request
Sample response
{
"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": "2024-07-01T23:11:22+00:00"
}
]
},
"disks": [
{
"name": "myOsDisk",
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded",
"time": "2024-07-01T21:29:47.477089+00:00"
}
]
}
],
"hyperVGeneration": "V1",
"assignedHost": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup/hosts/myHost",
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded",
"time": "2024-07-01T21:30:12.8051917+00:00"
},
{
"code": "PowerState/running",
"level": "Info",
"displayStatus": "VM running"
}
]
}
Get Virtual Machine Instance View.
Sample request
Sample response
{
"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",
"patchStatus": {
"availablePatchSummary": {
"status": "Succeeded",
"assessmentActivityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"rebootPending": true,
"criticalAndSecurityPatchCount": 1,
"otherPatchCount": 2,
"startTime": "2020-04-24T21:02:04.2556154Z",
"lastModifiedTime": "2020-04-24T21:02:04.2556154Z",
"error": null
},
"lastPatchInstallationSummary": {
"status": "Succeeded",
"installationActivityId": "68f8b292-dfc2-4646-9981-33cc88631968",
"maintenanceWindowExceeded": false,
"notSelectedPatchCount": 1,
"excludedPatchCount": 1,
"pendingPatchCount": 1,
"installedPatchCount": 1,
"failedPatchCount": 1,
"startTime": "2020-04-24T21:02:04.2556154Z",
"lastModifiedTime": "2020-04-24T21:02:04.2556154Z",
"error": null
},
"configurationStatuses": [
{
"code": "PatchModeConfigurationState/Ready",
"level": "Info",
"displayStatus": "Status_PatchModeConfigurationState_Ready",
"time": "2020-04-24T21:02:04.2556154Z"
},
{
"code": "AssessmentModeConfigurationState/Pending",
"level": "Info",
"displayStatus": "Status_AssessmentModeConfigurationState_Pending",
"time": "2020-04-24T21:02:04.2556154Z"
}
]
},
"isVMInStandbyPool": false,
"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 |
---|---|
Api |
Api error. |
Api |
Api error base. |
Available |
The available patch summary of the latest assessment operation for the virtual machine. |
Boot |
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. |
Cloud |
An error response from the Compute service. |
Disk |
Specifies the encryption settings for the OS Disk. |
Disk |
The virtual machine disk information. |
Hyper |
Specifies the HyperVGeneration Type associated with a resource |
Inner |
Inner error details. |
Instance |
Instance view status. |
Key |
Specifies the location of the key encryption key in Key Vault. |
Key |
Specifies the location of the disk encryption key, which is a Key Vault Secret. |
Last |
The installation summary of the latest installation operation for the virtual machine. |
Maintenance |
The Last Maintenance Operation Result Code. |
Maintenance |
The Maintenance Operation status on the virtual machine. |
Patch |
The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." |
Status |
The level code. |
Sub |
The relative URL of the Key Vault containing the secret. |
Virtual |
The VM Agent running on the virtual machine. |
Virtual |
The virtual machine extension handler instance view. |
Virtual |
The extensions information. |
Virtual |
The health status for the VM. |
Virtual |
The instance view of a virtual machine. |
Virtual |
[Preview Feature] The status of virtual machine patch operations. |
ApiError
Api error.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
The Api error details |
|
innererror |
The Api inner error |
|
message |
string |
The error message. |
target |
string |
The target of the particular error. |
ApiErrorBase
Api error base.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
message |
string |
The error message. |
target |
string |
The target of the particular error. |
AvailablePatchSummary
The available patch summary of the latest assessment operation for the virtual machine.
Name | Type | Description |
---|---|---|
assessmentActivityId |
string |
The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. |
criticalAndSecurityPatchCount |
integer |
The number of critical or security patches that have been detected as available and not yet installed. |
error |
The errors that were encountered during execution of the operation. The details array contains the list of them. |
|
lastModifiedTime |
string |
The UTC timestamp when the operation began. |
otherPatchCount |
integer |
The number of all available patches excluding critical and security. |
rebootPending |
boolean |
The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. |
startTime |
string |
The UTC timestamp when the operation began. |
status |
The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." |
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. Note: This will not be set if boot diagnostics is currently enabled with managed storage. |
serialConsoleLogBlobUri |
string |
The serial console log blob Uri. Note: This will not be set if boot diagnostics is currently enabled with managed storage. |
status |
The boot diagnostics status information for the VM. Note: It will be set only if there are errors encountered in enabling boot diagnostics. |
CloudError
An error response from the Compute service.
Name | Type | Description |
---|---|---|
error |
Api error. |
DiskEncryptionSettings
Specifies the encryption settings for the OS Disk.
Minimum api-version: 2015-06-15
Name | Type | Description |
---|---|---|
diskEncryptionKey |
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 |
Specifies the location of the key encryption key in Key Vault. |
DiskInstanceView
The virtual machine disk information.
Name | Type | Description |
---|---|---|
encryptionSettings |
Specifies the encryption settings for the OS Disk. |
|
name |
string |
The disk name. |
statuses |
The resource status information. |
HyperVGenerationType
Specifies the HyperVGeneration Type associated with a resource
Name | Type | Description |
---|---|---|
V1 |
string |
|
V2 |
string |
InnerError
Inner error details.
Name | Type | Description |
---|---|---|
errordetail |
string |
The internal error message or exception dump. |
exceptiontype |
string |
The exception type. |
InstanceViewStatus
Instance view status.
Name | Type | Description |
---|---|---|
code |
string |
The status code. |
displayStatus |
string |
The short localizable label for the status. |
level |
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 |
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 |
The relative URL of the Key Vault containing the secret. |
LastPatchInstallationSummary
The installation summary of the latest installation operation for the virtual machine.
Name | Type | Description |
---|---|---|
error |
The errors that were encountered during execution of the operation. The details array contains the list of them. |
|
excludedPatchCount |
integer |
The number of all available patches but excluded explicitly by a customer-specified exclusion list match. |
failedPatchCount |
integer |
The count of patches that failed installation. |
installationActivityId |
string |
The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. |
installedPatchCount |
integer |
The count of patches that successfully installed. |
lastModifiedTime |
string |
The UTC timestamp when the operation began. |
maintenanceWindowExceeded |
boolean |
Describes whether the operation ran out of time before it completed all its intended actions |
notSelectedPatchCount |
integer |
The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. |
pendingPatchCount |
integer |
The number of all available patches expected to be installed over the course of the patch installation operation. |
startTime |
string |
The UTC timestamp when the operation began. |
status |
The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." |
MaintenanceOperationResultCodeTypes
The Last Maintenance Operation Result Code.
Name | Type | Description |
---|---|---|
MaintenanceAborted |
string |
|
MaintenanceCompleted |
string |
|
None |
string |
|
RetryLater |
string |
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 |
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. |
PatchOperationStatus
The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."
Name | Type | Description |
---|---|---|
CompletedWithWarnings |
string |
|
Failed |
string |
|
InProgress |
string |
|
Succeeded |
string |
|
Unknown |
string |
StatusLevelTypes
The level code.
Name | Type | Description |
---|---|---|
Error |
string |
|
Info |
string |
|
Warning |
string |
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 |
The virtual machine extension handler instance view. |
|
statuses |
The resource status information. |
|
vmAgentVersion |
string |
The VM Agent full version. |
VirtualMachineExtensionHandlerInstanceView
The virtual machine extension handler instance view.
Name | Type | Description |
---|---|---|
status |
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 |
The resource status information. |
|
substatuses |
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. |
VirtualMachineHealthStatus
The health status for the VM.
Name | Type | Description |
---|---|---|
status |
The health status information for the VM. |
VirtualMachineInstanceView
The instance view of a virtual machine.
Name | Type | Description |
---|---|---|
assignedHost |
string |
Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. Minimum api-version: 2020-06-01. |
bootDiagnostics |
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 |
The virtual machine disk information. |
|
extensions |
The extensions information. |
|
hyperVGeneration |
Specifies the HyperVGeneration Type associated with a resource |
|
isVMInStandbyPool |
boolean |
[Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. |
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. |
patchStatus |
[Preview Feature] The status of virtual machine patch operations. |
|
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 |
The resource status information. |
|
vmAgent |
The VM Agent running on the virtual machine. |
|
vmHealth |
The health status for the VM. |
VirtualMachinePatchStatus
[Preview Feature] The status of virtual machine patch operations.
Name | Type | Description |
---|---|---|
availablePatchSummary |
The available patch summary of the latest assessment operation for the virtual machine. |
|
configurationStatuses |
The enablement status of the specified patchMode |
|
lastPatchInstallationSummary |
The installation summary of the latest installation operation for the virtual machine. |