我们正在验证是否为 Azure VM 配置了备份。使用以下 REST API https://docs.microsoft.com/en-us/rest/api/compute/virtual-machines/instance-view,我们能够检索到仅用于 Linux VM 的 Ex 输出所需的信息:
{
"computerName": "vm01",
"osName": "ubuntu",
"osVersion": "20.04",
"vmAgent": {
"vmAgentVersion": "2.5.0.2",
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Ready",
"message": "Guest Agent is running",
"time": "2021-11-17T13:52:54+00:00"
}
],
"extensionHandlers": [
{
"type": "Microsoft.Azure.RecoveryServices.VMSnapshotLinux",
"typeHandlerVersion": "1.0.9187.0",
"status": {
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Ready",
"message": "Plugin enabled"
}
}
]
},
...
}
Windows 虚拟机
{
"computerName": "vm02",
"osName": "Windows Server 2019 Datacenter",
"osVersion": "10.0.17763.2300",
"vmAgent": {
"vmAgentVersion": "2.7.41491.1029",
"statuses": [
...
]
},
"disks": [
...
],
"bootDiagnostics": {},
"hyperVGeneration": "V1",
"statuses": [
...
]
}
在extensionHandlers我们有Microsoft.Azure.RecoveryServices.VMSnapshotLinux,但在 Windows 虚拟机上没有等价物。有什么办法可以做到这一点?
我们没有使用这种方法https://docs.microsoft.com/en-us/azure/backup/backup-azure-arm-userestapi-backupazurevms#discover-unprotected-azure-vms因为我们需要执行批量验证和保管库信息不可用。