Virtual Machines - Instance View
检索有关虚拟机运行时状态的信息。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView?api-version=2025-04-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
vm
|
path | True |
string |
虚拟机的名称。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure作已成功完成。 |
|
| Other Status Codes |
意外错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
| 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.
示例请求
示例响应
{
"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": "2025-04-01T23:11:22+00:00"
}
]
},
"disks": [
{
"name": "myOsDisk",
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded",
"time": "2025-04-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": "2025-04-01T21:30:12.8051917+00:00"
},
{
"code": "PowerState/running",
"level": "Info",
"displayStatus": "VM running"
}
]
}
Get Virtual Machine Instance View.
示例请求
示例响应
{
"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"
}
]
}
定义
| 名称 | 说明 |
|---|---|
|
Api |
API 错误。 |
|
Api |
Api 错误库。 |
|
Available |
描述可用修补程序摘要的虚拟机实例视图的属性。 |
|
Boot |
虚拟机启动诊断的实例视图。 |
|
Cloud |
来自计算服务的错误响应。 |
|
Disk |
描述磁盘的加密设置 |
|
Disk |
磁盘的实例视图。 |
|
Hyper |
指定与资源关联的 HyperVGeneration 类型 |
|
Inner |
内部错误详细信息。 |
|
Instance |
实例视图状态。 |
|
Key |
描述对 Key Vault 密钥的引用 |
|
Key |
描述对 Key Vault 机密的引用 |
|
Last |
描述上次安装的修补程序摘要的属性。 |
|
Maintenance |
上次维护作结果代码。 |
|
Maintenance |
维护作状态。 |
|
Patch |
作的总体成功或失败状态。 在作完成之前,它将保持“InProgress”状态。 此时,它将变为“未知”、“失败”、“成功”或“CompletedWithWarnings”。 |
|
Status |
级别代码。 |
|
Sub |
|
|
Virtual |
虚拟机上运行的虚拟机代理的实例视图。 |
|
Virtual |
虚拟机扩展处理程序的实例视图。 |
|
Virtual |
虚拟机扩展的实例视图。 |
|
Virtual |
VM 的运行状况。 |
|
Virtual |
虚拟机的实例视图。 |
|
Virtual |
虚拟机修补作的状态。 |
ApiError
API 错误。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| details |
Api 错误详细信息 |
|
| innererror |
Api 内部错误 |
|
| message |
string |
错误消息。 |
| target |
string |
特定错误的目标。 |
ApiErrorBase
Api 错误库。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
错误消息。 |
| target |
string |
特定错误的目标。 |
AvailablePatchSummary
描述可用修补程序摘要的虚拟机实例视图的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| assessmentActivityId |
string |
生成此结果的作的活动 ID。 它用于跨 CRP 和扩展日志进行关联。 |
| criticalAndSecurityPatchCount |
integer (int32) |
已检测到可用但尚未安装的关键修补程序或安全修补程序的数量。 |
| error |
执行作期间遇到的错误。 details 数组包含它们的列表。 |
|
| lastModifiedTime |
string (date-time) |
作开始时的 UTC 时间戳。 |
| otherPatchCount |
integer (int32) |
所有可用补丁的数量,不包括关键修补程序和安全修补程序。 |
| rebootPending |
boolean |
VM 的总体重新启动状态。 当部分安装的补丁需要重新启动才能完成安装但尚未重新启动时,情况确实如此。 |
| startTime |
string (date-time) |
作开始时的 UTC 时间戳。 |
| status |
作的总体成功或失败状态。 在作完成之前,它将保持“InProgress”状态。 此时,它将变为“未知”、“失败”、“成功”或“CompletedWithWarnings”。 |
BootDiagnosticsInstanceView
虚拟机启动诊断的实例视图。
| 名称 | 类型 | 说明 |
|---|---|---|
| consoleScreenshotBlobUri |
string |
控制台屏幕截图 blob URI。 注意: 如果当前使用托管存储启用了启动诊断,则 不会 设置此设置。 |
| serialConsoleLogBlobUri |
string |
串行控制台日志 blob Uri。 注意: 如果当前使用托管存储启用了启动诊断,则 不会 设置此设置。 |
| status |
VM 的启动诊断状态信息。 注意: 仅当在启用启动诊断时遇到错误时,才会设置它。 |
CloudError
来自计算服务的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
API 错误。 |
DiskEncryptionSettings
描述磁盘的加密设置
| 名称 | 类型 | 说明 |
|---|---|---|
| diskEncryptionKey |
指定磁盘加密密钥的位置,该密钥是 Key Vault 机密。 |
|
| enabled |
boolean |
指定是否应在虚拟机上启用磁盘加密。 |
| keyEncryptionKey |
指定 Key Vault 中密钥加密密钥的位置。 |
DiskInstanceView
磁盘的实例视图。
| 名称 | 类型 | 说明 |
|---|---|---|
| encryptionSettings |
指定 OS 磁盘的加密设置。 |
|
| name |
string |
磁盘名称。 |
| statuses |
资源状态信息。 |
HyperVGenerationType
指定与资源关联的 HyperVGeneration 类型
| 值 | 说明 |
|---|---|
| V1 | |
| V2 |
InnerError
内部错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| errordetail |
string |
内部错误消息或异常转储。 |
| exceptiontype |
string |
异常类型。 |
InstanceViewStatus
实例视图状态。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
状态代码。 |
| displayStatus |
string |
状态的简短可本地化标签。 |
| level |
级别代码。 |
|
| message |
string |
详细状态消息,包括警报和错误消息。 |
| time |
string (date-time) |
状态的时间。 |
KeyVaultKeyReference
描述对 Key Vault 密钥的引用
| 名称 | 类型 | 说明 |
|---|---|---|
| keyUrl |
string |
引用 Key Vault 中的密钥加密密钥的 URL。 |
| sourceVault |
包含密钥的 Key Vault 的相对 URL。 |
KeyVaultSecretReference
描述对 Key Vault 机密的引用
| 名称 | 类型 | 说明 |
|---|---|---|
| secretUrl |
string |
引用 Key Vault 中的机密的 URL。 |
| sourceVault |
包含机密的 Key Vault 的相对 URL。 |
LastPatchInstallationSummary
描述上次安装的修补程序摘要的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
执行作期间遇到的错误。 details 数组包含它们的列表。 |
|
| excludedPatchCount |
integer (int32) |
所有可用修补程序的数量,但被客户指定的排除列表匹配明确排除。 |
| failedPatchCount |
integer (int32) |
安装失败的补丁计数。 |
| installationActivityId |
string |
生成此结果的作的活动 ID。 它用于跨 CRP 和扩展日志进行关联。 |
| installedPatchCount |
integer (int32) |
成功安装的修补程序计数。 |
| lastModifiedTime |
string (date-time) |
作开始时的 UTC 时间戳。 |
| maintenanceWindowExceeded |
boolean |
描述作在完成所有预期作之前是否已用完时间 |
| notSelectedPatchCount |
integer (int32) |
所有可用修补程序的数量,但由于与分类或包含列表条目不匹配而不会安装。 |
| pendingPatchCount |
integer (int32) |
在修补程序安装作过程中预期安装的所有可用修补程序的数量。 |
| startTime |
string (date-time) |
作开始时的 UTC 时间戳。 |
| status |
作的总体成功或失败状态。 在作完成之前,它将保持“InProgress”状态。 此时,它将变为“未知”、“失败”、“成功”或“CompletedWithWarnings”。 |
MaintenanceOperationResultCodeTypes
上次维护作结果代码。
| 值 | 说明 |
|---|---|
| None | |
| RetryLater | |
| MaintenanceAborted | |
| MaintenanceCompleted |
MaintenanceRedeployStatus
维护作状态。
| 名称 | 类型 | 说明 |
|---|---|---|
| isCustomerInitiatedMaintenanceAllowed |
boolean |
True,如果允许客户执行维护。 |
| lastOperationMessage |
string |
为上次维护作返回的消息。 |
| lastOperationResultCode |
上次维护作结果代码。 |
|
| maintenanceWindowEndTime |
string (date-time) |
维护时段的结束时间。 |
| maintenanceWindowStartTime |
string (date-time) |
维护时段的开始时间。 |
| preMaintenanceWindowEndTime |
string (date-time) |
维护前时段的结束时间。 |
| preMaintenanceWindowStartTime |
string (date-time) |
预维护时段的开始时间。 |
PatchOperationStatus
作的总体成功或失败状态。 在作完成之前,它将保持“InProgress”状态。 此时,它将变为“未知”、“失败”、“成功”或“CompletedWithWarnings”。
| 值 | 说明 |
|---|---|
| Unknown | |
| InProgress | |
| Failed | |
| Succeeded | |
| CompletedWithWarnings |
StatusLevelTypes
级别代码。
| 值 | 说明 |
|---|---|
| Info | |
| Warning | |
| Error |
SubResource
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID |
VirtualMachineAgentInstanceView
虚拟机上运行的虚拟机代理的实例视图。
| 名称 | 类型 | 说明 |
|---|---|---|
| extensionHandlers |
虚拟机扩展处理程序实例视图。 |
|
| statuses |
资源状态信息。 |
|
| vmAgentVersion |
string |
VM 代理完整版。 |
VirtualMachineExtensionHandlerInstanceView
虚拟机扩展处理程序的实例视图。
| 名称 | 类型 | 说明 |
|---|---|---|
| status |
扩展处理程序状态。 |
|
| type |
string |
指定扩展的类型;例如“CustomScriptExtension”。 |
| typeHandlerVersion |
string |
指定脚本处理程序的版本。 |
VirtualMachineExtensionInstanceView
虚拟机扩展的实例视图。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
虚拟机扩展名称。 |
| statuses |
资源状态信息。 |
|
| substatuses |
资源状态信息。 |
|
| type |
string |
指定扩展的类型;例如“CustomScriptExtension”。 |
| typeHandlerVersion |
string |
指定脚本处理程序的版本。 |
VirtualMachineHealthStatus
VM 的运行状况。
| 名称 | 类型 | 说明 |
|---|---|---|
| status |
VM 的运行状况信息。 |
VirtualMachineInstanceView
虚拟机的实例视图。
| 名称 | 类型 | 说明 |
|---|---|---|
| assignedHost |
string |
当虚拟机与启用了自动放置的专用主机组相关联时,通过自动放置分配虚拟机的专用主机的资源 ID。 最低 API 版本:2020-06-01。 |
| bootDiagnostics |
启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图来诊断 VM 状态。 可以轻松查看控制台日志的输出。 通过 Azure,还可以从虚拟机监控程序查看 VM 的屏幕截图。 |
|
| computerName |
string |
分配给虚拟机的计算机名称。 |
| disks |
虚拟机磁盘信息。 |
|
| extensions |
扩展信息。 |
|
| hyperVGeneration |
指定与资源关联的 HyperVGeneration 类型 |
|
| isVMInStandbyPool |
boolean |
[预览功能]指定虚拟机当前是在备用池中还是在备用池中。 |
| maintenanceRedeployStatus |
虚拟机上的维护作状态。 |
|
| osName |
string |
虚拟机上运行的作系统。 |
| osVersion |
string |
虚拟机上运行的作系统版本。 |
| patchStatus |
[预览功能]虚拟机修补作的状态。 |
|
| platformFaultDomain |
integer (int32) |
指定虚拟机的容错域。 |
| platformUpdateDomain |
integer (int32) |
指定虚拟机的更新域。 |
| rdpThumbPrint |
string |
远程桌面证书指纹。 |
| statuses |
资源状态信息。 |
|
| vmAgent |
虚拟机上运行的虚拟机代理。 |
|
| vmHealth |
VM 的运行状况。 |
VirtualMachinePatchStatus
虚拟机修补作的状态。
| 名称 | 类型 | 说明 |
|---|---|---|
| availablePatchSummary |
虚拟机最新评估作的可用修补程序摘要。 |
|
| configurationStatuses |
指定 patchMode 的启用状态 |
|
| lastPatchInstallationSummary |
虚拟机最新安装作的安装摘要。 |