Uploading Server 2003r2 to Azure

So, yeah…  Do what?  Why would you ever move a 2003 server to Azure?   Don’t you know its end of life?

Ok, hear me out, but there are times when companies do silly things like install applications that get well rooted, but then the software company goes under or the team that took care of the application was laid off and it went into the the “just reboot it” maintenance mode by administrators that knew nothing of it.   Fast forward 10 years and here you are on hardware that is sketchy at best and no one wants to breath anywhere near it.

Well, there’s a few things that you can do to keep it alive a bit longer.   Thankfully we’ll start this journey with Hyper-V.   2012r2 still is capable of running 2003r2.  Azure of course, is currently based off this platform, so easy wins.   I’ll skip converting a physical machine to a vm, but there’s tools out there, and I’ll assume you’re capable in Hyper-V to migrate a vm from one to another if you’re needing to move the vm to a 2012r2 hypervisor.

So, lets do this, and then, lets go to the bar, share a few stories about 2003, and then pretend we never did this.

First thing, first – make sure the integrate services are installed and then make sure remote desktop is enabled (and, yes – open the firewall for it).    While you’re there – install windows updates.

 

 

 

 

 

AddTools RemoteDesktop

Next, Power down the VM, go into settings, and go to the disk.  Edit the disk and convert it to a VHD and Fixed size.   Save it somewhere you’ll remember and click finish to start the convert.   Feel free to walk away for a few minutes after clicking.

 

ConvertDisk1  ConvertDisk2Convertdisk3ConvertDisk4  ConvertDisk5

Then, you have to get the file from hyper-v host to azure.  If you can’t get to the hyper-v’s drive.  Well, RDP over to the hyper-v host, login, go to the command prompt and type “netsh firewall set service fileandprint”.

Now I use a tool Cloudberry explorer to migrate the file up.  The real trick is that the copy must be as page blob.  Any blob won’t do, Azure vm’s only like the page.  If you don’t know where to find the keys and storage name information cloudberry is asking for, go to azure, click on your storage, and click the key icon at the bottom.

upload00 upload0Upload1

Now them, once the copy starts… well, go bake a cake or something.

Once uploaded, we need to issue one command in Azure Powershell to make the disk available to add.


Add-AzureDisk -OS Windows -MediaLocation "https://(storagename).blob.core.windows.net/vhds/(name).vhd" -DiskName "(name)"

AddDiskAzure

We’re close, really – if you didn’t get an error here, Azure at least likes the disk format.

Now then, lets make a vm in Azure.  Making a VM from Gallery and selecting my disk will list the uploaded disk.  From there its your standard add vm, with the Azure VM type, network and all that good stuff.

2003Azure2 2003Azure1

Now, wait a few minutes, watch it spin up and connect to it.   There you go, you’ve shamed yourself by adding Server 2003 to the cloud.

Note, there is an easy way to convert the vhdx as well.  You can powershell it.


Convert-VHD (filename).vhdx -DestinationPath c:\VHD\(servername).vhd -VHDType Fixed

2003Azure3

One last thing, for Hyper-V, another way to allow the C$ to be exposed is specific port opening for file sharing and reboot:


netsh advfirewall firewall set portopening ALL 139 “Share1″

netsh advfirewall firewall set portopening ALL 445 “Share2”


Leave a Reply

Your email address will not be published. Required fields are marked *