Queries about snapshot and sys preparation

sns 9,246 Reputation points
2023-11-22T18:01:45.22+00:00
  1. Please provide me the exact steps to take snapshot of VM
  2. how does it sys prepartion work when we do /restart and /shutdown?

If sys preparation fails we want to look at the logs and we want to have that VM till sys preparation successfully executed.

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

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,811 Reputation points Microsoft Employee Moderator
    2023-11-22T19:55:00.7766667+00:00

    Hello, @sns !

    How do I take a snapshot of a VM VHD?

    A snapshot is a full, read-only copy of a virtual hard disk (VHD). You can use a snapshot as a point-in-time backup, or to help troubleshoot virtual machine (VM) issues. You can take a snapshot of both operating system (OS) or data disk VHDs.

    https://learn.microsoft.com/en-us/azure/virtual-machines/snapshot-copy-managed-disk?tabs=portal

    1. In the Azure portal, select Create a resource.
    2. Search for and select Snapshot.
    3. In the Snapshot window, select Create. The Create snapshot window appears.
    4. For Resource group, select an existing resource group or enter the name of a new one.
    5. Enter a Name, then select a Region and Snapshot type for the new snapshot. If you would like to store your snapshot in zone-resilient storage, you need to select a region that supports availability zones. For a list of supporting regions, see Azure regions with availability zones.
    6. For Source subscription, select the subscription that contains the managed disk to be backed up.
    7. For Source disk, select the managed disk to snapshot.
    8. For Storage type, select Standard HDD, unless you require zone-redundant storage or high-performance storage for your snapshot.
    9. If needed, configure settings on the Encryption, Networking, and Tags tabs. Otherwise, default settings are used for your snapshot.
    10. Select Review + create.

    How does sysprep work?

    Running sysprep.exe /oobe /generalize /shutdown is part of generalizing a VM that removes all your personal account and security information, and then prepares the machine to be used as an image (this is not necessary for creating an image in an Azure Compute Gallery). This process is not reversible.

    After you have run Sysprep on a VM, that VM is considered generalized. The VM will shut down and cannot be restarted. If you need to keep the original VM functioning, you should create a snapshot of the OS disk, create a VM from the snapshot, and then generalize that copy of the VM.

    What if things go wrong with sysprep?

    It's rare for errors to occur when running sysprep but be sure to read through unsupported sysprep scenarios:

    https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview?view=windows-11#unsupported-scenarios

    Creating a snapshot of the original VM (as covered above) and generalizing the snapshot is recommended if you want to keep the original VM functioning.


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image


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.