This weekend I began migrating some servers from a Xen Server to a Hyper-V server.
The process was pretty straight forward, as I had tested this, the week before, in the lab environment.
- using Xen Center, Power off the VM and export the server. Ensure to not select the 'one file' option.
- Open the export folder when complete, and copy (and rename) the vhd file
- Create the new VM on the Hyper-V server and attach the exported disk
- Power up
- Uninstall Xen Tools
- Install Hyper-V Guest tools
- Rub hands gleefully.
It was during the last phase that I ran into a roadblock. Obviously there was a change of hardware, requiring a reboot. The problem was, that once it was up, there was no internet connectivity. I was able to do anything on the LAN. I was also able to get dns lookups for external addresses, but I couldnt get traffic out of the LAN from this server.
The issue, it turned out, was that during the addition of the Hyper-V NIC, a persistent Route was added for 0.0.0.0 using the NIC as the gateway.
In a command window, use ROUTE PRINT to see your routing table.
the solution, was to remove this persistent route;
route delete 0.0.0.0
and re-add it with the correct gateway;
route add 0.0.0.0 mask 0.0.0.0 <gateway ip>