/dev/centos/root does not exist after migrating CentOS7 from vmware to Xen

Solution 1:

I've been using Starwinds V2V converter https://www.starwindsoftware.com/converter for a similar task a while ago. It supports multiple virtual machine disks formats and does internal hardware patching during conversion. There is an option to enable Rescue Mode during conversion too and it supports batch processing of multiple VMs. And it's free.

Saved me a lot of time literally. Give it a try.

Solution 2:

There was the same question on Reddit.

The main idea — you need to regenerate initrd.

  1. Boot into linux rescue
  2. Call dracut -f according to this article.

Solution 3:

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:
1.) Export XEN VM to OVA (or convert .xva XEN appliance using any tool, like Starwind)
2.) Create NEW VM in Hyper-V and attach previously exported VHD
3.) Mount the ISO from above link in new Hyper-V VM's DVD/CDROM drive, and boot from it.
4.) 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)
5.) 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"
6.) Reboot and enjoy your Linux VM running on Hyper-V :)