VM boot diagnostics - az vm boot-diagnostics

Troubleshoot the start up of an Azure Virtual Machine.

When bringing your own image to Azure or even booting one of the platform images, there can be many reasons why a VM gets into a non-bootable state. These features enable you to easily diagnose and recover your VMs from boot failures.

Commands

az vm boot-diagnostics disable Disable the boot diagnostics on a VM.
az vm boot-diagnostics enable Enable the boot diagnostics on a VM.
az vm boot-diagnostics get-boot-log Get the boot diagnostics log from a VM.

az vm boot-diagnostics disable

Disable the boot diagnostics on a VM.

az vm boot-diagnostics disable --name
--resource-group

Examples

Disable boot diagnostics by Name and Group

az vm boot-diagnostics disable -n name -g MyResourceGroup

Disable boot diagnostics by VM Ids

az vm boot-diagnostics disable --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Required Parameters

--name -n

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az vm boot-diagnostics enable

Enable the boot diagnostics on a VM.

az vm boot-diagnostics enable --name
--resource-group
--storage

Examples

Enable boot diagnostics by Name and Group

az vm boot-diagnostics enable --storage https://mystor.blob.core.windows.net/ -n name -g MyResourceGroup

Enable boot diagnostics by VM Ids

az vm boot-diagnostics enable --storage https://mystor.blob.core.windows.net/ --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Required Parameters

--name -n

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--storage

A storage account name or a uri like https://your_stoage_account_name.blob.core.windows.net/.

az vm boot-diagnostics get-boot-log

Get the boot diagnostics log from a VM.

az vm boot-diagnostics get-boot-log --name
--resource-group

Examples

Get boot diagnostics log by Name and Group

az vm boot-diagnostics get-boot-log -n name -g MyResourceGroup

Get boot diagnostics log by VM Ids

az vm boot-diagnostics get-boot-log --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

Required Parameters

--name -n

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.