A former twenty something in technology

Windows Azure VM Subscription Transfer

I successfully managed to transfer my Windows Azure Virtual Machine to a different subscription without losing any files with minimal downtime.

How did I do it?

I followed the steps on the Windows Azure Documentation: How to Capture an Image of a Virutal Machine Running Windows Server
  1. Ran sysprep on my Windows VM (C:\Windows\System32\Sysprep\Sysprep.exe)
  2. Waited about 10 minutes for operation to complete and system shutdown
  3. Clicked Capture
Then UH OH! You're going to delete my virtual machine? But that means I will lose my IP address because there will be no VMs running under that domain. THERE HAS GOT TO BE A BETTER WAY. In fact there is. So what I did was:
  1. Created a new extra small Ubuntu virtual machine and added to an existing virtual machine (the one I was about to capture).
  2. Added Apache quickly to host a web server letting people know I'm down. (sudo apt-get install apache2)
  3. Modified the default index.html (sudo vim /var/www/index.html) and created a nice maintenance message.
  4. Created a new endpoint for port 80 temporarily to the Ubuntu virtual machine.
  5. Back on the primary machine. Started the Capture.
  6. When the capture was finished. I created a new virtual machine utilizing the image I just captured and set the subscription to the one wanted to move too.
  7. VM booted up. I had to re-add my attached disk
  8. Removed Port 80 endpoint from the Ubuntu virtual machine and applied it to the newly created Windows machine.
  9. Shutdown Ubuntu VM (I will keep you around for future maintenance since you no longer cost me money except the small storage charge)
BAM! Site migrated to the new subscription and website is up and running without any loss to data.  

No comments yet.

Leave a Reply