Updating the Linux boot image before migrating from VMWare to Hyper-V
-
I have migrated a number of CentOS 7 VM's successfully now.
As soon as the backup completes, I will be running the script on a CentOS 5 box (Elastix 2.4)
-
The Elastix 2.4 VM migrated well. I had to remove the network adapter afterwards and put in a legacy adapter from Hyper-V but then it came right up.
-
Hello. Was pointed to this thread by someone in the Spiceworks Community. I'm migrating VMware VMs to Hyper-V. Some are CentOS machines. In order to create an initramfs file with the hyper-v modules, do I need to install something for hyper-v in the VM as it sits on VMware? Thanks for any input.
-
@rg2016 said in Updating the Linux boot image before migrating from VMWare to Hyper-V:
Hello. Was pointed to this thread by someone in the Spiceworks Community. I'm migrating VMware VMs to Hyper-V. Some are CentOS machines. In order to create an initramfs file with the hyper-v modules, do I need to install something for hyper-v in the VM as it sits on VMware? Thanks for any input.
No, this should be a core part of CentOS.
-
@JaredBusch said in Updating the Linux boot image before migrating from VMWare to Hyper-V:
@rg2016 said in Updating the Linux boot image before migrating from VMWare to Hyper-V:
Hello. Was pointed to this thread by someone in the Spiceworks Community. I'm migrating VMware VMs to Hyper-V. Some are CentOS machines. In order to create an initramfs file with the hyper-v modules, do I need to install something for hyper-v in the VM as it sits on VMware? Thanks for any input.
No, this should be a core part of CentOS.
Thank you very much!
-
Thank you for posting this. It was a great help to me. I found that I could use 5Nine to transfer the VM to Hyper-V, boot into rescue mode when bringing up the VM on Hyper-V and run the mkinitrd command. The VM then boots normally.
-
@rg2016 said in Updating the Linux boot image before migrating from VMWare to Hyper-V:
Thank you for posting this. It was a great help to me. I found that I could use 5Nine to transfer the VM to Hyper-V, boot into rescue mode when bringing up the VM on Hyper-V and run the mkinitrd command. The VM then boots normally.
That is what I posted above. You had to do it either before or after the migration. I had current backups to roll back to in case of a problem, so I simply did it prior to the migration. Either way works to rebuild it though.
-
I've successfully migrated several Ubuntu VMs from ESXi and XenServer to HyperV 2012 by exporting the VM and then using Starwind's VHD converter. I've not had to run any scripts on the Linux VMs before shutting them down and exporting.
-
SUPER old post, I know, but I am running into this issue as well.
I am migrating one VM (CentOS 7, FreePBX) from a KVM VM to a Hyper-V server. I used the conversion tool "qemu-img" which worked great for another Windows workload I converted.
I did not run the command as you noted in the post before the conversion. so now I am stuck with a boot error:
Warning /dev/s7_freepbx/root does not exist Warning /dev/s7_freepbx/swap does not exist
I booted into rescue mode with a recovery DVD/Image. I pressed 1 to continue. It told me "Your system has been mounted under /mnt/sysimage. I pressed return to drop into a shell.
I tried the command below.mkinitrd -f -v --with=hid-hyperv --with=hv_utils --with=hv_vmbus --with=hv_storvsc --with=hv_netvsc /boot/initramfs-$(uname -r).img $(uname -r)
I got the error:
dracut: Cannot find /usr/lib/dracut/dracut-init.sh
So I typed "chroot /mnt/sysimage" and tried the command again.
and got the error below
-
After I posted this, I ran the same command again, and it appeared to complete successfully. Then I rebooted and got the same exact error message.
Warning /dev/s7_freepbx/root does not exist Warning /dev/s7_freepbx/swap does not exist
-
In case anyone else runs across this same issue, I got this resolved with a simple command:
dracut --regenerate-all -f && grub2-mkconfig -o /boot/grub2/grub.cfg
After doing this, everything booted up properly.
I then installed hyperv-daemons, rebooted, and everything works great.