Forum Discussion
Tom Harvey
May 18, 2017Copper Contributor
Revert to Azure Managed Disk snapshot on Azure VM
Hi All, Looking for some assistance in reverting a Managed disk snapshot to an OS disk of the VM. Idealy i would like to do the following: 1. Detach existing OS managed disk from VM 2. Conve...
Panos Tsapralis
May 23, 2018Copper Contributor
Hi Tom. I have a similar problem and I came across your message. I think that the proper thing to do would be to first stop/deallocate the VM. Then you should be allowed to detach the old OS disk from its configuration and attach the new OS disk to it (the one, that you have created from the snapshot) and startup the VM. I have not had time to test this yet since my problem is more complicated than yours (my VM is a rather "fat" SQL Server instance with two -2- data disks attached to it in addition to its OS disk) - I hope that I will be able to test it some time later - please, let me know of your findings if you use this approach.
Tom Harvey
May 27, 2018Copper Contributor
Hi Panos,
I haven't spent any more time on this since my post. I wrote a script that will recreate the Disk from the snapshot and then recreate the VM using the new Disk. It deletes the VM but retains the VM components, nic, pip etc. The whole process takes about 5 minutes which isn't too bad. Sometimes when the VM comes back up its lost its domain account although it's an easy fix and happens 1 out of every 10 restores old say. Needless to say, the process is working for us I'm just surprised there isn't an easier option. On your note, I'm not sure you can detach / attach an os Disk from a VM, not sure I've tried that although could be a better option.
I'm happy to share my script for anyone interested, been a few comments on here since my last post.
I haven't spent any more time on this since my post. I wrote a script that will recreate the Disk from the snapshot and then recreate the VM using the new Disk. It deletes the VM but retains the VM components, nic, pip etc. The whole process takes about 5 minutes which isn't too bad. Sometimes when the VM comes back up its lost its domain account although it's an easy fix and happens 1 out of every 10 restores old say. Needless to say, the process is working for us I'm just surprised there isn't an easier option. On your note, I'm not sure you can detach / attach an os Disk from a VM, not sure I've tried that although could be a better option.
I'm happy to share my script for anyone interested, been a few comments on here since my last post.
- DeletedJul 23, 2018
Hi Can you please send me the script too.
- DeletedJul 10, 2018Tom Harvey, Please send me your script.
I appreciate it
Robin Hood