I am migrating a CentOS 7 system from VMware Server 2 to XenServer 6.5. The CentOS system was installed using the minimal installation. I used ovftool to convert the .vmdk file to a .img using the instructions here
https://www.mylesgray.com/virtualisation/using-vmwares-ovftool-convert-vmx-ova/
and imported this into XenServer using XenCenter. Upon booting I get the following errors:
dracut-initqueue[286]: Warning: dracut-initqueue timeout - starting timeout scripts
dracut-initqueue[286]: Warning: /dev/centos/root does not exist
dracut-initqueue[286]: Warning: /dev/centos/swap does not exist
dracut-initqueue[286]: Warning: /dev/mapper/centos-root does not exist
It goes on to start the emergency shell.
I think the problem is down to the device name of the disk. On the original system the disk is on /dev/sda. On the new system it is /dev/xvda. Using the installation disk I can boot into the rescue mode and it mounts /mnt/sysimage. I don't know how to fix the problem though. The only file I can find related to the device name is in /mnt/sysimage/boot/grub2/device.map. I tried changing this to
(hd0) /dev/xvda
but it made no difference. I presume the logical disk manager configuration needs changing somewhere.
How can I fix this? I need simple(ish) instructions as I'm not a Linux expert, especially in relation to the boot process.
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.
There was the same question on Reddit.
The main idea — you need to regenerate initrd.
dracut -f
according to this article.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 :)
The reason why you’re seeing this is due of initramfs kernel image being build for the specific system it's running on, so migrating to a new hardware will cause it to fail to boot.
Rebuilding initramfs in emergency mode(or go to the Rescue Mode ):
Then
or if it's an UEFI system
Delete the old menuentry and make sure that the new menuentry is top of all
Generate a GRUB configuration file
Reboot
Done.
I had lost my boot partition, so no help doing the
dracut -f
command.I could, however, boot to rescue kernel, and ran a
yum update
, which installed a new kernel and fixed whatever it was that caused this.There is something to be said for not running systems on the bleeding edge!