Converting Linux machine from XenServer to Hyper-V
EDITED ANSWER: I've been thinking about your problem, and I think that rsync or dd backup/restore might be your best bet. If you are using dynamically growing vhdds, then rsync is probably your best bet, and if you are using statically defined disks, then dd is probably your best bet.
Option 1: First, you will have to create a samba or cfs share, or attach a physical drive by some other means to backup the data. Once you have a backup destination attached, you will have to run the rsync or dd command to backup the drive.
Rsync example (using Arch): https://wiki.archlinux.org/index.php/full_system_backup_with_rsync
DD example: http://www.thegeekstuff.com/2010/10/dd-command-examples/
I'm pretty sure you can pipe rsync into gzip if you want to create a portable file.
Then you must install Centos in a new hyper-v machine. Then you have to go through the task of restoring the backup image (which will differ depending on the command you used to create it).
Option 2: Alternatively, you could create the new CentOS VM first, and then mount the other exported VHD file to the same virtual machine under Hyper-V. Since you will have both drives mounted to the same machine, you could go through the migration process at that point. Once you have mounted the backup drive and migrated your bootloader over to it, you can unmount the replacement VM drive. You could then re-use the same drive to migrate your other machines (rinse and repeat for each VM you need to migrate). If you have many machines you could attempt to script this process, or you might be able to find a backup script already out there.
Option 3: Create the new VHD/VHDX file with hyper-V, and then attach and mount it to the Xenserver guest you wish to duplicate, and do the backup directly that way.
I know there are a lot of hoops to jump through, there are three solid options that will probably work without too much fuss. I'm kind of newb with Linux, but I've moved HD images around fairly easily with DD before, and I don't see why it wouldn't work nicely here.
ORIGINAL ANSWER:
If you are using LVM, then the HDDs shouldn't be causing the problem and HD links should be intact after conversion, but I am no expert. I have a fair amount of experience with Linux under Hyper-V, but not converting XenServer machines to Hyper-V. That being said, the error you are seeing suggests to me that it might be an issue with the linux kernel. It would be helpful to know which Linux distribution you are using.
XenServer has two VM types:
HVM VMs - these are equal to Hyper-V VMs and need no changes. These VMs can be converted to Hyper-V machines by conventional means (copy VHD or use System Center 2012 Virtual Machine Manager (VMM) as recommended by Microsoft).
PV VMs - these are 'para virtualized' VMs and don't have a full boot kernel. They are bound to the OS of the VM and share some of the bootloader to bootstrap the machine. You need to replace the PV kernel (kernel-xen) in the VM with the pae kernel (kernel-pae).
I don't know what linux distribution you are using, and that may have some effect on the actual solution, but, assuming the VMs are PV VMs, the following link has instructions on installing the PV kernel on the Linux box, so you want to do the reverse of these instructions, adapting for your Linux distribution. Then the export process should work:
http://itproctology.blogspot.ca/2009/06/pv-enabling-hvm-from-vmware-on.html
This answer assumes you are using PV kernel on your Xenserver vms, and assumes that is the problem causing boot failure. It also assumes you have already tried using System Center 2012 Virtual Machine Manager (VMM) to convert the vms (as per Microsoft best practices, steps shown at the following link):
https://technet.microsoft.com/en-ca/library/gg610672.aspx
Final Notes:
- I might try disabling secure boot and seeing if that makes a difference.
- Make sure to follow Microsoft Best Practices for Linux VMs (depending on the distribution you are using). These can be found at the following links, and you could try making those change to the VM prior to doing the export process (be sure to back-up your virtual machine first):
Universal Linux VM under Hyper-V best practices: https://technet.microsoft.com/en-ca/library/dn720239.aspx
Distribution specific Linux VM under Hyper-V best practices: https://technet.microsoft.com/en-ca/library/dn531030.aspx
Lastly, here's what my Linux kernel params look like (Ubuntu/Debian) for my virtual machines (in /etc/default/grub, make sure to run sudo update-grub afterwards):
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1366x768 elevator=noop numa=off"
The video=hyperv_fb option will only work once hyper-v integration tools are installed on the VM (distribution specific).
I know that this answer comes in late, but I thought I would share how I got around this. I was also searching for an answer migrating CentOS7 VM's from XenServer 6.5 to Hyper-V 2016. I tried everything from Starwind, to exporting as XVA appliance and converting it using XenConvert 2.3.1, with no avail.
The solution is actually very simple, and worked the first time: Download this ISO - https://sourceforge.net/projects/boot-repair-cd/
High-level steps that I took:
- Export XEN VM to OVA (or convert .xva XEN appliance using any tool, like Starwind)
- Create NEW VM in Hyper-V and attach previously exported VHD
- Mount the ISO from above link in new Hyper-V VM's DVD/CDROM drive, and boot from it.
- Follow the prompts (NB!!! Make sure that the VM has a NIC attached that connects to an external network that hands out DHCP and internet access)
- Select auto repair (NB!! on the step where it reinstalls GRUB, you might need to modify the yum command, in my case I had to use - "yum erase grub*" instead of "yum erase grub*-common"
- Reboot and enjoy your Linux VM running on Hyper-V :)