Instructions for Azure

Azure virtual machines cannot boot from ISO images. To enable Bare Metal Recovery (BMR) in Azure, use Cove Rescue Media in VHD format.

This VHD image is designed specifically for Azure and includes:

  • cloud-init for automated configuration
  • Azure Linux VM Agent for integration with Azure services
  • Compatibility with the Azure Serial Console, which you can use to perform BMR through the Azure portal

Using this VHD ensures a seamless recovery experience in Azure environments.

BMR on Azure involves the following:

  1. Download the rescue VHD file

  2. Upload the rescue VHD file to Azure Blob Storage

  3. Create a Managed disk from the rescue VHD file

  4. Attach the Managed disk to the target machine

  5. Boot the target machine

  6. Perform recovery

  7. Boot the target machine from recovered OS disk

 

To do Bare Metal Recovery on Azure

  1. Download the Cove Rescue Media in VHD format from:

  2. Session-specific rescue VHD files are not supported. You cannot restore VHD files from the Restore tab.

  3. Upload the rescue VHD file to Azure Blob Storage. To upload the rescue VHD file, you need:

    • An Azure Storage account

    • A container in Azure Blob Storage

    For details, see the following official Microsoft Azure documentation:

    You can upload the VHD file through the Azure portal or by using the following Azure CLI command. Replace the placeholder values in angle brackets (< >) with your own:

    az storage blob upload \
        --account-name <storage-account> \
        --container-name <container> \
        --file <path-to-vhd-file> \
        --name <vhd-file-name> \
        --auth-mode login

    For example,

    az storage blob upload \
        --account-name coverescuestorageaccount \
        --container-name cove-rescue-media-container \
        --name cove-rescue-media-linux.vhd \
        --file ~/Downloads/cove-rescue-media-linux.vhd \
        --auth-mode login
  4. Use the following command to create a managed disk in Azure from the VHD file you uploaded to Azure Blob Storage. Replace the placeholder values in angle brackets (< >) with your own:
  5. az disk create \
        --resource-group <resource-group> \
        --name <managed-disk-name> \
        --source https://<storage-account>.blob.core.windows.net/<container>/<vhd-file-name> \
        --location <location> \
        --zone <zone> \
        --os-type Linux \
        --security-type <security-type> \
        --architecture x64 \
        --sku <sku> \
        --hyper-v-generation <hyper-v-generation>

    Example:

    az disk create \
        --resource-group DefaultResourceGroup \
        --name cove-rescue-media-linux \
        --source https://coverescuestorageaccount.blob.core.windows.net/cove-rescue-media-container/cove-rescue-media-linux.vhd \
        --location eastus \
        --zone 1 \
        --os-type Linux \
        --security-type TrustedLaunch \
        --architecture x64 \
        --sku Premium_LRS \
        --hyper-v-generation V2

    The values for parameters such as resource group, zone, security type, and Hyper-V generation must match the target virtual machine. If they do not match, the managed disk cannot be attached as the OS disk to the virtual machine.

  6. Attach the managed disk with the rescue system to the target virtual machine.

    1. If the target and source machines are the same
      1. In the Azure portal, go to the Disks page for the target VM.

      2. Swap the OS disk so that the managed disk containing the rescue system becomes the OS disk.

      3. Attach the original OS disk as a data disk.

      This step is required because the original OS disk will be recovered; it will be repartitioned, and files and folders will be restored on it. For more information, see Swap the OS disk.

    2. If the target machine is a new blank VM

      Migrate the source system to a new VM. To do so:

      1. Create blank managed disks that match the size and number of disks on the source machine.

      2. The disk that will become the OS disk after recovery must have the same OS type, Hyper-V generation, and security type as the target VM.
        This disk cannot be created in the Azure portal. Use the Azure CLI instead.

      3. Use the following command to create the OS disk. Replace the placeholder values in angle brackets (< >) with your own:

      4. az disk create \
            --resource-group <resource group> \
            --name <disk name> \
            --size-gb <disk size> \
            --os-type Linux \
            --hyper-v-generation <hyper-v-generation> \
            --sku <sku> \
            --security-type <security-type> \
            --zone <zone>

        For example,

        az disk create \
            --resource-group DefaultResourceGroup  \
            --name target-vm-os-disk \
            --size-gb 30 \
            --os-type Linux \
            --hyper-v-generation V2 \
            --sku Premium_LRS \
            --security-type TrustedLaunch \
            --zone 1
      5. Go to the managed disk that contains the rescue system and select Create VM to create the target virtual machine from this disk.

      6. Then, during target VM creation, attach the blank disks as data disks.

        During recovery, the attached data disks will be repartitioned, and files and folders will be restored on them.

  7. Boot the target VM Go to the target VM’s Overview page. Verify that the managed disk containing the rescue system is attached as the OS disk, and then select Start.

  8. Perform recovery via SSH or Azure Serial Console. You can recover the system by either:

    • Setting up an SSH connection to the target VM

    • Using the Azure Serial Console

  9. For details on connecting to a VM, see Connect to the VM in the official Microsoft Azure documentation,

    Run the following command to start the recovery process:

    cove recover

    If you connect to the VM over SSH using a non-root account, run sudo cove recover. The recovery script requires root privileges.

    For more information about the recovery process, see the Bare Metal Recovery instructions. The process is the same as performing recovery with the Cove Rescue ISO image in hypervisor environments.

  10. Boot the target machine from the recovered OS disk After recovery completes:

    1. Detach the Cove Rescue managed disk from the target VM.

    2. Swap the original OS disk back so the VM boots from the recovered OS disk.

    3. Start the VM and verify that the system has been successfully recovered.