az vm boot-diagnostics
排查 Azure 虚拟机的启动问题。 使用此功能对自定义或平台映像的启动失败进行故障排除。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az vm boot-diagnostics disable |
在 VM 上禁用启动诊断。 |
Core | GA |
| az vm boot-diagnostics enable |
在 VM 上启用启动诊断。 |
Core | GA |
| az vm boot-diagnostics get-boot-log |
从 VM 获取启动诊断日志。 |
Core | GA |
| az vm boot-diagnostics get-boot-log-uris |
获取 SAS URI 以进行虚拟机的启动诊断。 |
Core | GA |
az vm boot-diagnostics disable
在 VM 上禁用启动诊断。
az vm boot-diagnostics disable [--ids]
[--name]
[--resource-group]
[--subscription]
示例
在资源组中的所有 VM 上禁用启动诊断。
az vm boot-diagnostics disable --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)
在 VM 上禁用启动诊断
az vm boot-diagnostics disable --ids $(az vm list --resource-group MyResourceGroup --query "[].id" -o tsv) --name MyVirtualMachine --resource-group MyResourceGroup
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az vm boot-diagnostics enable
在 VM 上启用启动诊断。
az vm boot-diagnostics enable [--ids]
[--name]
[--resource-group]
[--storage]
[--subscription]
示例
在资源组中的所有 VM 上启用启动诊断。
az vm boot-diagnostics enable --storage https://mystor.blob.core.windows.net/ --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)
在 VM 上启用启动诊断。 (autogenerated)
az vm boot-diagnostics enable --name MyVirtualMachine --resource-group MyResourceGroup --storage https://mystor.blob.core.windows.net/
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
存储帐户的名称或 URI(例如 https://your_storage_account_name.blob.core.windows.net/)。 如果未指定,将使用托管存储。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az vm boot-diagnostics get-boot-log
从 VM 获取启动诊断日志。
az vm boot-diagnostics get-boot-log [--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取资源组中所有 VM 的诊断日志。
az vm boot-diagnostics get-boot-log --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)
从 VM 获取启动诊断日志。 (autogenerated)
az vm boot-diagnostics get-boot-log --name MyVirtualMachine --resource-group MyResourceGroup
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az vm boot-diagnostics get-boot-log-uris
获取 SAS URI 以进行虚拟机的启动诊断。
az vm boot-diagnostics get-boot-log-uris [--expire]
[--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取虚拟机启动诊断日志的 SAS URI。
az vm boot-diagnostics get-boot-log-uris -g MyResourceGroup -n MyVirtualMachine
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
SAS URI 的过期持续时间(以分钟为单位)值介于 1 到 1440 分钟之间。 如果未指定,则会生成默认过期持续时间为 120 分钟的 SAS URI。
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |