Options to choose when restoring an encrypted vm

Handinata Tanudjaja 170 Reputation points
2025-02-18T01:47:11.48+00:00

Hi all,

In the Azure documentations, there are 2 options to restore encrypted VM:

  1. After you restore the VM disk, you can manually swap the OS disk of the original VM with the restored VM disk without re-creating it.
  2. Recreate the VM instance.

My question is in what situation I can do option 1 above? And why?
Also what situation I can do option 2 above? And why?

Thank you

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,562 questions
0 comments No comments
{count} votes

Accepted answer
  1. anashetty 2,560 Reputation points Microsoft External Staff
    2025-02-18T03:23:27.95+00:00

    Hi Handinata Tanudjaja,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    In Azure, when restoring an encrypted VM, as you said we have two options: manually swapping the OS disk or recreating the VM instance. Based on the scenario and your specific requirements you choose an option.

    1. After you restore the VM disk, you can manually swap the OS disk of the original VM with the restored VM disk without re-creating it.

    When to use this:
    When you want Virtual Machine with minimal downtime, swapping the OS disk is faster than recreating the entire VM.
    If you want to keep the original VM's settings, like network settings, public IP addresses, extensions, and attached data disks. You don't need to change the VM size, networking, or other settings during the restore process.
    If you want to test the restored disk without affecting the original VM. You can attach the restored disk as a data disk or create a new VM for testing.

    Why: Swapping the OS disk method is quicker and more efficient because you're only swapping the OS disk without touching the rest of the VM's configuration. It avoids the need to recreate the VM from scratch. It's particularly useful when the VM itself is still functional, but you need to restore the operating system to a previous working state. Retains the VM's existing metadata, configurations, and resources, making it ideal for quick recovery when the infrastructure setup is complex.

    2. Recreate the VM instance.

    When to use this:
    If the original VM is completely deleted, corrupted, or otherwise unrecoverable, and you need to recreate it from scratch. You want to make changes to the VM configuration during the restore process such as selecting a different size, region, or availability set.
    You need to restore not just the OS disk but also the entire VM configuration, including networking, public IPs, and extensions.

    Why: This approach is better when you need to restore everything, not just the OS disk. Recreating the VM gives you more flexibility, especially if the original VM configuration is problematic or unavailable. It ensures that you can fully restore the VM, including encryption settings, by starting from scratch while attaching the restored disk. Useful in disaster recovery scenarios where you need to recreate the environment from backups due to catastrophic failure.

    For your reference:
    Change the OS disk used by an Azure VM using PowerShell
    Restore encrypted Azure virtual machines
    How to restore Azure VM data in Azure portal

    If you have any further queries, please do let us know. If the answer is helpful, please click "Accept Answer" and "Upvote it."

    User's image


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.