Troubleshoot Azure Linux VM when there's no access to Azure Serial Console and the disk layout uses Logical Volume Manager

Applies to: ✔️ Linux VMs

This article provides a troubleshooting guide for an Azure Linux virtual machine (VM) where all the following conditions are presented:

  • The VM isn't booting up.
  • Connection to the VM by using SSH isn't possible.
  • The Azure Serial Console access is unavailable.
  • The VM is using Logical Volume Manager (LVM) in the operating system (OS) disk.

Prerequisites

  • To use the Azure VM repair commands, the following access is required:

  • To perform the recovery operation, a temporary VM is required. To create such a VM, you need the corresponding permissions at the Azure subscription level.

Prepare the rescue VM

  1. Use VM repair commands to create a rescue VM that has a copy of the affected VM's OS disk attached.

    Note

    Alternatively, you can create a rescue VM manually by using the Azure portal. For more information, see Troubleshoot a Linux VM by attaching the OS disk to a recovery VM using the Azure portal.

    • If you create the rescue VM manually instead of using the VM repair commands, to avoid issues due to duplicated LVM structures, you must select an image without LVM in the OS disk. If using Red Hat-based VMs, you need to search the image by using "Red Hat RAW." Ubuntu and SUSE images don't use LVM in the OS disk.

    • If the LVM utilities are missing in the Red Hat RAW image, install the LVM utilities.

  2. Connect to the rescue VM and mount the copy of the OS file systems in the rescue VM by using chroot.

    When you execute commands in a chroot environment, they're executed against the attached OS Disk instead of the local rescue VM.

  3. Once the troubleshooting is complete, perform the following actions:

    1. Exit chroot.
    2. Unmount the copy of the file systems from the rescue VM.
    3. Run the az vm repair restore command to swap the repaired OS disk with the original OS disk of the VM. For more information, see Step 5 in Repair a Linux VM by using the Azure Virtual Machine repair commands.
    4. Validate if the VM is able to boot up by taking a look at the Azure Serial Console or by trying to connect to the VM.

Enable Serial Console

If access to the Serial Console is still not possible, verify the GRUB configuration parameters for your Linux VM and correct them. For more information, see Serial Console GRUB proactive configuration.

Common troubleshooting scenarios

Scenario 1: Configure the VM to boot from a different kernel

A common scenario is to force a VM to boot from a previous kernel, as the currently installed kernel may have become corrupt or an upgrade didn't complete correctly.

To do this, follow the steps in Boot system on older kernel version. You can also check Recent kernel downgrade.

Scenario 2: Kernel update issues

A failed kernel upgrade can cause the VM to be non-bootable. For more information about the actions to perform the Kernel update, see Kernel update process.

Scenario 3: LVM swap volume misconfiguration in GRUB

In this scenario, a VM fails to complete the boot process and enters the dracut emergency shell due to an invalid swap device path in the GRUB configuration.

To resolve the issues, perform the steps in Wrong swap device path in GRUB configuration file.

Next steps

For further no boot troubleshooting options, see Troubleshoot Azure Linux Virtual Machines boot errors.

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.