
Azure Boot Diagnostics is a powerful tool that helps you troubleshoot issues with your virtual machines (VMs) in Azure. It captures a screenshot of your VM's boot process and provides a detailed view of the boot diagnostics.
To enable boot diagnostics, you need to attach a diagnostic storage account to your VM. This can be done during the creation of the VM or later, in the Azure portal.
Boot diagnostics can capture screenshots of your VM's boot process, including any errors that may occur during the boot process. This can be especially helpful when troubleshooting issues with your VM.
The diagnostic storage account stores the boot diagnostics data, which can be accessed through the Azure portal.
Intriguing read: Azure Storage Not Displaying
Enable Diagnostics on Existing VM
To enable diagnostics on an existing virtual machine, you'll need to follow a few simple steps.
First, sign in to the Azure portal and select the virtual machine you want to enable diagnostics on.
Expand your knowledge: Azure Performance Diagnostics Extension
You can find the Boot diagnostics feature in the Help section of your virtual machine.
Select Boot diagnostics and then click on the Settings tab.
In Boot diagnostics settings, you can choose to use either a managed storage account or a custom storage account for boot diagnostics.
Note that using a premium storage account is not supported for Boot diagnostics, and you may receive an error if you try to use one.
To confirm that boot diagnostics is enabled, make sure that Boot diagnostics is turned on in the Monitoring section of the Management tab.
If you're not sure which storage account type to use, a managed storage account is the default setting and usually the recommended option.
Expand your knowledge: Azure Ad Unlock Account
Deploying and Troubleshooting
To deploy and troubleshoot Azure Boot Diagnostics, you need to navigate to your virtual machine resource and append the diagnostics profile section. Set the API version header to "2015-06-15" or later, with the latest version being "2018-10-01".
Readers also liked: Azure Diagnostics Manager
On the Management tab, in the Monitoring section, make sure that Boot diagnostics is turned on. The default setting is to have boot diagnostics enabled using a managed storage account.
If you use a premium storage account for Boot diagnostics, you might receive the StorageAccountTypeNotSupported error when you start the VM.
Deploying from a Template
If you're deploying from an Azure Resource Manager template, you'll need to navigate to your virtual machine resource and append the diagnostics profile section.
Set the API version header to "2015-06-15" or later. The latest version is "2018-10-01".
This diagnostics profile allows you to select the storage account where you want to put these logs.
For more information on deploying resources using templates, see Quickstart: Create and deploy Azure Resource Manager templates by using the Azure portal.
VM Troubleshooting
VM troubleshooting is a crucial step in ensuring your Azure virtual machines are running smoothly. You can troubleshoot issues by using the "Troubleshoot" option in the portal.
If you're experiencing connectivity issues, such as being unable to RDP into your VM, try using the "Redeploy" option. This will migrate the virtual machine to a new Azure host, and any data on the temporary drive will be lost.
Redeploying a VM can resolve connectivity issues, but it's not a foolproof solution. In some cases, you may need to use a more drastic approach.
To troubleshoot VM issues, you can also enable boot diagnostics. This will provide you with information about the VM's boot process, such as whether it's stuck in a reboot loop.
To enable boot diagnostics, follow these steps:
- Sign in to the Azure portal, and then select the virtual machine.
- In the Help section, select Boot diagnostics, then select the Settings tab.
- In Boot diagnostics settings, select the boot diagnostics with managed storage account or custom storage account.
- Save the change.
If redeploying or enabling boot diagnostics doesn't resolve the issue, you can try attaching the OS disk from the faulty VM to a working VM. This can help you diagnose the issue by loading the registry hive from the faulty VM.
To attach the OS disk, follow these steps:
- In the portal open the settings for a working Azure VM and attach the OS disk from 'FaultyServer' to this machine (Disks > Attach existing).
- Once the disk has been attached, open the registry editor and load the hive from the OS disk.
By following these steps, you can troubleshoot VM issues and get your virtual machines up and running smoothly.
A fresh viewpoint: Azure B
Enabling Serial Console in Windows VM
Enabling Serial Console in Windows VM is a relatively simple process, but it's essential to know that it's dependent on the age of the Windows image used to create your VM. If your VM was created with a pre-2018 Windows image, you may not have serial console output enabled.
Fortunately, enabling serial console output is easy to do in the settings for your VM. You can type in to access the settings.
To enable serial console output, you'll need to check if your VM was created with a pre-2018 Windows image. If it was, you can easily enable serial console output in the settings for your VM.
Take a look at this: How to Start Azure Vm in Safe Mode
Accessing SAC/Safe Mode CLI
To access the SAC/Safe Mode CLI, start by going to your Azure subscription and finding the VM you need serial access to. Select it from the list. From the list of functions on the left, scroll down and select 'Serial console'. Once SAC has loaded, type in 'cmd' and press enter. This will allow you to run commands to troubleshoot your system.
Take a look at this: Azure Access
Access Forbidden... Errors Loading Sac
Having a firewall active on the storage account associated with the VM's boot diagnostics can cause 'Access Forbidden...' errors when loading SAC.
You can resolve this by temporarily turning the firewall off or by adding your existing location to its list of acceptable IPs.
To temporarily turn off the firewall, browse to your Azure Storage Account -> Settings and ensure the radio button for "Allow access from" is set to "All Networks".
This is a common issue that can be frustrating, especially if you're not familiar with Azure settings.
See what others are reading: Windows Azure Storage Services
Sources
- https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/boot-diagnostics
- https://www.boomam.com/docs/azure/azure_how-to_recovering-an-azure-windows-vm
- https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_virtualmachine_module.html
- https://blog.kloud.com.au/2016/06/09/azure-vm-troubleshooting-part-1/
- https://www.sqlservercentral.com/blogs/use-boot-diagnostics-to-see-what-your-azure-vm-is-doing-at-boot-time
Featured Images: pexels.com