Virtual Machine Scale Set VMs - Get Instance View

Gets the status of a virtual machine from a VM scale set.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView?api-version=2024-03-01

URI Parameters

Name In Required Type Description
instanceId
path True

string

The instance ID of the virtual machine.

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.

vmScaleSetName
path True

string

The name of the VM scale set.

api-version
query True

string

Client Api Version.

Responses

Name Type Description
200 OK

VirtualMachineScaleSetVMInstanceView

OK

Other Status Codes

CloudError

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 from a VM scale set placed on a dedicated host group through automatic placement.

Sample Request

GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet/virtualMachines/0/instanceView?api-version=2024-03-01

Sample Response

{
  "platformUpdateDomain": 0,
  "platformFaultDomain": 0,
  "rdpThumbPrint": null,
  "vmAgent": {
    "vmAgentVersion": "Unknown",
    "statuses": [
      {
        "code": "ProvisioningState/Unavailable",
        "level": "Warning",
        "displayStatus": "Not Ready",
        "message": "VM status blob is found but not yet populated.",
        "time": "2024-03-01T05:00:32+00:00"
      }
    ],
    "extensionHandlers": null
  },
  "disks": [
    {
      "name": "myOSDisk",
      "encryptionSettings": null,
      "statuses": [
        {
          "code": "ProvisioningState/succeeded",
          "level": "Info",
          "displayStatus": "Provisioning succeeded",
          "message": null,
          "time": "2024-03-01T04:58:58.0882815+00:00"
        }
      ]
    }
  ],
  "extensions": null,
  "assignedHost": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup/hosts/myHost",
  "bootDiagnostics": null,
  "statuses": [
    {
      "code": "ProvisioningState/succeeded",
      "level": "Info",
      "displayStatus": "Provisioning succeeded",
      "message": null,
      "time": "2020-06-05T04:59:58.1852966+00:00"
    },
    {
      "code": "PowerState/running",
      "level": "Info",
      "displayStatus": "VM running",
      "message": null,
      "time": null
    }
  ]
}

Definitions

Name Description
ApiError

Api error.

ApiErrorBase

Api error base.

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.

CloudError

An error response from the Compute service.

DiskEncryptionSettings

Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15

DiskInstanceView

The disks information.

HyperVGeneration

The hypervisor generation of the Virtual Machine [V1, V2]

InnerError

Inner error details.

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.

VirtualMachineHealthStatus

The health status for the VM.

VirtualMachineScaleSetVMInstanceView

The instance view of a virtual machine scale set VM.

ApiError

Api error.

Name Type Description
code

string

The error code.

details

ApiErrorBase[]

The Api error details

innererror

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.

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

InstanceViewStatus

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

ApiError

Api error.

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 disks 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.

HyperVGeneration

The hypervisor generation of the Virtual Machine [V1, V2]

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

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.

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

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.

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

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.

VirtualMachineHealthStatus

The health status for the VM.

Name Type Description
status

InstanceViewStatus

The health status information for the VM.

VirtualMachineScaleSetVMInstanceView

The instance view of a virtual machine scale set VM.

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

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

Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

Max-length (Windows): 15 characters

Max-length (Linux): 64 characters.

For naming conventions and restrictions see Azure infrastructure services implementation guidelines.

disks

DiskInstanceView[]

The disks information.

extensions

VirtualMachineExtensionInstanceView[]

The extensions information.

hyperVGeneration

HyperVGeneration

The hypervisor generation of the Virtual Machine [V1, V2]

maintenanceRedeployStatus

MaintenanceRedeployStatus

The Maintenance Operation status on the virtual machine.

osName

string

The Operating System running on the hybrid machine.

osVersion

string

The version of Operating System running on the hybrid machine.

placementGroupId

string

The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId.

platformFaultDomain

integer

The Fault Domain count.

platformUpdateDomain

integer

The Update Domain count.

rdpThumbPrint

string

The Remote desktop certificate thumbprint.

statuses

InstanceViewStatus[]

The resource status information.

vmAgent

VirtualMachineAgentInstanceView

The VM Agent running on the virtual machine.

vmHealth

VirtualMachineHealthStatus

The health status for the VM.