P2V of a Microsoft Windows 2003 Small Business Server using CloneZilla to Hyper-V

All the hallmarks of net pain are right there in the title.

  • P2V.
  • Microsoft Windows 2003 Small Business Server
  • Using CloneZilla.
  • To Hyper-V.

First of all, Windows Server 2003 Small Business Server is awful. It’s old, it’s unsupported, and the friendly features work against you more than they work with you. Not to mention that as a final fuck you, it decided that it was not permitted license-wise to do a domain trust to a new forest, further complicating our migration. But that’s another blog post whatsoever.

Second, why am I using CloneZilla instead of some more supported tool? Well… there doesn’t actually seem to be any good P2V solutions to Hyper-V. Microsoft has a P2V tool that’s part of System Center Virtual Machine Manager, which we’re not going to install for a single-hypervisor node. So, that means we’re on our own from Microsoft. I don’t even think their official P2V even supports Windows Server 2003 anyway, but I digress.

The other go-to method for a simple P2V into Hyper-V is using the awesome tool called Disk2vhd. I’ve used this in the past to great success, but I decided not to use this method this time, because the machine I’m cloning from is a domain controller and a mail server. It’s not a good idea to clone these online, because the clone you get will always be stale, and you get “time warp” effects including lost e-mail that might have been delievered while the clone was in progress.

So, I elect to use CloneZilla. I plan on using it in disk_to_remote_disk mode, as documented in this Wiki artickle from Ogala Lakota College. Last edited in December 2009. So the article is over six years out of date already. I feel the pain already…

My plan is to run the CloneZilla live CD on the Hyper-V box and use that to receive the clone, after booting the physical box with a burned CD of the ISO file of CloneZilla. No sense risking flaky USB booting on a machine of that vintage. My fall-back plan is to isolate the server from the network, and use Disk2vhd after all, which should in theory be fine as long as the server doesn’t talk to the network.

I download the ISO and for a moment I have to double check that the old creaky hardware actually supports 64-bit OS’es. Turns out it does. Armed with Plan A and half of a Plan B, I pack my backpack for the evening.


Arrived at the customer site, armed with the CD. I boot the machine with it. Notice the RAID array at the customer is degraded with both disks healthy. Maybe that had been causing some issues? Never mind, that’s exactly why I wanted to P2V.

After some ominous read errors on the CD drive, CloneZilla live booted without a hitch. Actually, the instructions seemed to be entirely up to date despite being written in 2009. Yay for stable software.

At some point, I’m presented with a choice between two hard drives. Hmm. Seems CloneZilla isn’t fooled by the server’s FakeRAID and presents the two drives seperately. Good thing it’s a RAID-1. Also, the array was degraded anyway, so I knew one of the two drives had to be stale.

I pressed Alt+F2, entering into the command shell, become root, and examine the situation using fdisk. Both drives have two NTFS partitions. (fdisk /dev/sda , then p to print the partition table, then q to exit without making changes)

I decide to look a little deeper to see which one’s recent and which one is stale. I mount the sda1 and sdb1 partitions read-only using these commands:

cd /mnt
mkdir a b
mount -t ntfs -o ro /dev/sda1 /mnt/a
mount -t ntfs -o ro /dev/sdb1 /mnt/b

After a bit of poking around and looking at file dates, it’s apparent that the copy on /dev/sdb is up-to-date. The other one is quite stale.

At that point I unmount the two partitions:

umount a
umount b

And return back to the menu’s using Alt+F1. Certain of my choice, I choose to clone from /dev/sdb

After following through, it gives me a few commands I need to type into the VM where I had booted CloneZilla before. The source machine is saying “Waiting for the target machine to connect…”

I enter the commands on the target machine, and a progress window shows up on the target machine! Success! Although there is no indication that there’s any file copy happening on the source machine… oh well. It’s definitely copying.

It asked a few questions regarding whether to copy over the boot loader etc, I just said yes.

I leave and come back to a progress bar at 90%. I watch it go to 100%, and then I realised I’d been trolled. The progress bar is volume by volume. Now, I still have to wait for the second volume to finish copying… all the while standing in the hot and untidy server closet at the customer, with nowhere to sit. I text my wife I expect to leave in about an hour 45 minutes – around 20.00 – after all, there’s another 22 minutes left on the file copy, and I’ll probably need just north of an hour to actually get the server to work right. Faith is high.

At this point, I’m waiting patiently, expecting the VM to come back up after reboot, probably screaming bloody murder about drivers, but in general being in a fixable state. I hope. 5 more minutes. I wait.

I write a hand-written note. “This machine – SRV03 – HP Proliant ML110 – must NOT BE STARTED”. Best to cover all the bases since the old server is not labeled with a hostname. I plan on unplugging the power from the server as soon as the copy has finished. Better safe than sorry with two almost-same but different SBS servers duking it out on the network in a Small Business Deathmatch. I duct tape the label over the power button. Oooh, copy complete. I restart the virtual machine after disconnecting the virtual CD-ROM, and I’m met by – nothing. A blinking cursor on a black screen.

At this point, I decide to spend a few minutes to find a way to sit down, hook up my laptop and get comfortable. This was going to take some effort.

After a few seconds of Googling (windows 2003 sbs hyper-v black screen cursor), I find a Technet blog article titled VM does not Boot Following P2V or Disk2VHD

Looks like I’m going to need to get Windows Server 2003 boot media. No problem. I grab an ISO off that off the Volume Licensing Service Center. Or so I thought. Microsoft no longer has ISO’s of that on VLSC. Meh. Figures though. I should have been better prepared and got an ISO of that onto the virtualization host just in case. I’m not surprised Microsoft has pulled the ISO’s, the product is no longer under support after all.

I VPN into our datacenter on a quest to locate a Windows Server 2003 ISO. We’re bound to have one laying around. For the first time ever I find the web-based datastore browser to actually be useful. Rooting around in a musty old folder named “From old datastore” I find a copy of Windows Server 2003 R2 32-bit. I’m pretty sure the server was running 32-bit to start, since I saw that it had PAE enabled. It’s not SBS, but for a bootup fix it shouldn’t matter.

I download the files, and then copy them up to the new shiny Hyper-V box. I spend a few minutes admiring progress bars, and mentally berating myself for not thinking of this ahead of time. Mental note: Always make sure there’s a copy of the install ISO for the P2V:ed or V2V:ed operating system ahead of the actual V2V. Better have it copied ahead of time instead of doing it over a VPN in an uncomfortably hot server closet.

I insert the virtual disc into the virtual DVD drive and reboot, and I see the windows installer. I get nostalgic for a moment as the old text-based pre-installer shows up.

I press R for repair, select my keyboard, select the windows install, type in the admin password, and then enter the magic incantations, and confirming along the way:

fixmbr
fixboot
bootcfg /rebuild
exit

I get up two possible boot options after rebooting, Windows Server 2003 for Small Business Server, and my new option I labeled “P2V”. I decide to choose the old option to see if it works. It’s not clean to have two options, so I plan on manually editing C:\boot.ini to clean it up, once I’ve established which one works. Then, I see the old familiar Windows Server 2003 boot screen. I wait.

The GUI loads, preparing network connections. I realise I’ve forgotten to note down the old IP address. No matter, I log on to their old firewall to look at the DHCP scope to find the DNS server, that’ll be it. Stupid. Should have known that setting would get reset, I just did another V2V a few hours ago.

It reaches the login screen, running at 640×480 resolution with no mouse support. Yay. Fortunately, I’m pretty good with keyboard navigation in windows. I insert the Hyper-V integration services disc, log in and make it the first order of business to install the integration services.

Windows wants to activate because of major hardware changes. I tell it to do it later, since it’s not likely to have working networking. At this point I’m ready to declare that I will be successful, so I shut off the source machine (which was still running CloneZilla), and unplug it from the power. I decide to also unplug it from the network. You can never be too safe.

The Hyper-V integration services finish installing, and it asks me to reboot. And the mouse actually works \o/ Faith is quite high. I reboot the server again.

The old crusty SBS takes quite some time to reboot, but it gets there in the end. That’s all the matters. I log in, and make sure to set the correct static IP. Suddenly, Microsoft gets all agressive on me and wants to activate NOW NOW NOW or it’ll shut down. I decide to let it, it should be able to get out to the Internet through a DHCP address. Activation passes without a hitch. Good, last thing I wanted was activation issues.

I investigate the VM config. Really? Only one CPU core? The old physical server had a dual-core Xeon (oooh!), at least it should have two cores… I plan on shutting down and adding another processor core after changing the IP address.

Wait a moment, where’s my explorer? After activating, all I got was a blue desktop background screen (not to be confused with a BSOD). I wait for a few minutes, still nothing. I hit Ctrl+Alt+Del, bring up a task manager, nothing’s taking the CPU. I decide to try to kill and re-launch the explorer manually. Nothing. Hmm. I launch cmd. That works. I decide to log out and then log back in. Still nothing. I decide to try a shut down. Might as well add that second CPU core now. Remembering from the back of my head that going between a single-processor and a multi-processor OS install can screw with things. Not sure if that’s applicable here.

I look at my watch. Half an hour until I estimated I’d get out of here. Looking a little unlikely but not impossible.

Realize after rebooting that the new boot config was the default when booting. Hmm. Maybe that’s a relevant difference? Remind myself again to tweak boot.ini once I get the IP settings right.

Phew. After a reboot, explorer pops up just like it should after reboot. Might have been either a bug with the activation, or with the wrong number of CPU’s, or the boot.ini. Don’t know, don’t care right now. 🙂

When changing the IP, I get warned about the same IP being present on another network adapter. I ignore that for now, making a note to remove the hidden network adapters.

I log on to the server through RDP rather than through the console. Not being stuck at 640×480 is a liberating experience.

I adjust the boot.ini, removing the redundant section from the boot configuration. I find the following in the config:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="P2V" 
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003 for Small Business Server" /noexecute=optout /fastdetect

This tells me it couldn’t possibly have been the two different boot options, since they both just do the same thing. I remove the line with P2V in it anyway. Boot.ini wouldn’t save in notepad, until I did this in CMD:

attrib -s -h -r c:\boot.ini

Then I saved, and I did:

attrib +s +h +r c:\boot.ini

Another reboot, to make sure everything seems to stick. I decide to shut it down using the integrations services to make sure that works right. It does.

I check my watch. 19.45. Looks like I’ll be able to leave when I expected after all! Or at least not too far off. I start packing my stuff, and type in the details in my phone to order an Uber home.

The server reboots, is RDP:able, I check the event log, nothing unexpected, looks good. Server sure is snappier than on the old hardware. Customer’s probably gonna like that. I shut down my computer and head home.

On the way home, I text the customer to call me in the morning, if anything’s broken. I plan on sleeping unmolested, though.

On-site off-hours work is just a pain in the net. But it could have been worse.

 

One thought on “P2V of a Microsoft Windows 2003 Small Business Server using CloneZilla to Hyper-V”

  1. Your a bloody ninja, and brought up many good tips that i wished i googled before sitting at the customers site in the same predicament. Except im all but certain that my VPN to home ISO repo is most likely in a broken state (also my bad).

    Thank you for this write up, at least i have a roadmap of things to try.

Leave a Reply

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