Reverting back to snapshot

sns 9,231 Reputation points

I have snapshot of OS disk, I want to revert to back to snapshot state of that VM, Please suggest how it can be done

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,549 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Luis Arias 5,981 Reputation points

    Hello sns, Reverting an Azure VM to a snapshot state in Azure is a bit different than in other environments.Even so Azure allows create disk snapshots, As I know for now it doesn't provide a direct option to revert the same VM back to the previously created snapshot.

    Here there is another conversation thread about it:

    Alternative option is creating a new disk from the snapshot and then swapping the OS disk of your VM with this new disk. Here are the steps:

    1. Create a new disk from the snapshot either by portal ( In the snapshot blade, click on + Create disk. ) or Azure PowerShell example:
    $SnapshotName = "my_snapshot"
    $SnapshotResourceGroup = "my_resource_group"
    $DiskNameOS = "my_new_snapshotdisk"
    $snapshotinfo = Get-AzSnapshot -ResourceGroupName $SnapshotResourceGroup -SnapshotName $snapshotName
    New-AzDisk -DiskName $DiskNameOS (New-AzDiskConfig -zone 1 -Location eastus -CreateOption Copy -SourceResourceId $snapshotinfo.Id) -ResourceGroupName $SnapshotResourceGroup
    1. From the Azure portal going to the VM, selecting "disks", and then selecting "swap os disk" ( it will cause a reboot )

    Let me know if you need additional help.


    If the information helped address your question, please Accept the answer.

    1 person found this answer helpful.
    0 comments No comments

  2. TP 83,711 Reputation points


    Navigate to snapshot in portal, click Create disk, complete necessary info and create. Wait for it to finish creating new Disk. Next navigate to the VM -- Disks blade, click Swap OS disk, select disk you created above, type in name of VM to confirm, click OK. Once the swap has finished you can navigate back to Overview blade and click Start.

    The above is for VM that only has OS disk.

    Please click Accept Answer and upvote if above was helpful.



    0 comments No comments