0

I made a stupid mistake. While looking for an easy way to make a backup of my Azure VM I followed directions to make a snapshot of the VM machine. In AWS (*which I am used to) a snapshot is a quick way to make an easily restorable backup. I guess MS uses a different concept.

During the steps I followed I ran sysprep on the VM. I stopped before I managed to delete the current VM, but it still seemed to delete all my access to that server.

Right now I am able to run the VM and see the web site, but I have no access via RDP to the machine. The endpoint is there, but it doesn't let me in.

How do I regain access to the running VM?

drobertson
  • 111
  • 1
  • 4
  • Running sysprep for the purpose of getting a snapshot or backup? That doesn't sound right. What are these steps that you followed? Can you provide a link to them? – joeqwerty Nov 22 '14 at 16:49
  • Here are the instructions I was following; http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/ To be fair I misread parts of the instructions and let my preconceptions of what I thought this did cloud my judgement. After I realized my mistake I looked at the numerous comments and it looks like lots of people had the same issue. – drobertson Nov 22 '14 at 20:27
  • 1
    Ok. Those would be appropriate if you were trying to create a template from which to deploy subsequent virtual machines. Those are not appropriate if you're trying to snapshot or backup your virtual machine. The virtual machine has been sysprepped, attaching the VHD(X) to a new virtual machine isn't going to do you any good. You're going to have to boot it up and let it run through the mini-setup/oobe process. – joeqwerty Nov 22 '14 at 21:29

2 Answers2

1

Sysprep is used to clone a VM not for backup purpose. By doing the above, you've reset the Windows VM to a default state which can be used for provisioning new VMs. Any 'user specific' settings would be lost but your files (non user specific) would still be on the VM.

You cannot regain access to the same Windows installation on the VM as it is gone now. What you can do is use the Image to create a new VM and then reconfigure that VM to act like your old one you just sysprepped. Hopefully this will be a minor task but it would depend on how customized your VM was.

To complete the explanation, the term snapshot is used in the context of an Amazon AMI wherein you can use it to clone a VM.

proteus
  • 674
  • 5
  • 13
  • I am coming from the Amazon AWS world where we would use snapshots as quick backups. My confusion led to this problem. At this point I stopped the image creation because it said it was going to delete my virtual machine. I have no idea why Microsoft thought this process made sense, but it really screwed me over. – drobertson Nov 22 '14 at 20:22
  • I am in the process of trying to set up a new VM and attach the HD to it. Hopefully this will work. I will give feedback on if this is successful. – drobertson Nov 22 '14 at 20:23
1

After many long conversations with the Azure tech people and lots of beating my head against the wall this was the eventual solution.

First, things were so corrupt at this point that no image file could be attached and no wrangling could fix the VM remotely.

We ended up detaching the drive from the current VM and deleting that VM instance (while retaining the old drive).

The next step was to create a new VM that was functioning and had all the necessary components. This was a bit of a complicated config, so this process has not been fun doing over again.

Once the new VM was completely set up and ready to go I attached the old drive to the currently working VM as a F: drive and migrated the data over by hand. Basically copying and pasting what was needed.

I am still working on safely migrating the MySQL database, but the majority of everything else is over on the new VM.

This was a major PITA and not a particularly satisfying way to restore a machine. I am also very worried that I missed something. I guess time will tell.

Please take this as a morality play on the dangers of using sysprep without clearly understanding what it does. They seriously need to put a label on that thing. It is damn dangerous.

Note - there was an alternative to this approach. I could have downloaded the VHD file for the machine and attempted to fix the instance using Hyper-V on my local system. At that point I could have uploaded it and started a new VM from that VHD. I chose not to do this because of the long upload/download time for the 130GB VHD file and the risk that it was going to be a futile effort.

drobertson
  • 111
  • 1
  • 4