CentOS 7 will not boot after migration to Hyper-V

General support questions
Post Reply
kinetix63
Posts: 1
Joined: 2017/03/10 08:54:44

CentOS 7 will not boot after migration to Hyper-V

Post by kinetix63 » 2017/03/10 11:09:02

Hi Everybody,

We are having a problem that I hope someone might be able to help with.

Our Virtual Host estate currently runs a rather old version of VMWare. We've been weighing up the pro's and con's of the various options available to us and have decided to migrate out VM estate to Hyper-V. We've got the majority of our Windows servers moved over which are working well, however we have a couple of CentOS VM guests that are causing us some real problems.

We have one guest, running CentOS 7, that I tried to migrate last night using both Microsoft's VM Converter and 5Nine's alternative. The migration over to Hyper-V works absolutely fine, but the guest refuses to boot and sticks on the screen shown in the attached screenshot.
centos-hv.png
centos-hv.png (14.9 KiB) Viewed 15188 times
I've tried a couple of different ways to fix this. We tried installing the Hyper-V Integration Services before migrating, tried it without, tried different converters, re-built the Initial Ramdisk image, and still we continue to experience this error.

I've attempted to look at the boot logs by booting in to Recovery mode (which we can boot in to), however there are no boot logs at all after the new guest has been powered up. So there appears to be a problem with the guest reading from/writing to disk, but I just don't know where to go from here.

Any help and suggestions would be very much appreciated.

Thank you,

Paul.

User avatar
TrevorH
Forum Moderator
Posts: 29117
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 7 will not boot after migration to Hyper-V

Post by TrevorH » 2017/03/10 12:15:29

Most likely your initramfs is missing support for the new "hardware". You need to rebuild the initramfs - which it sounds like you tried but I supsect you did it before the migration and you need to boot the rescue kernel (the one that works) and do it on the new "hardware" so that it autodetects what's present and builds the right initramfs file. Once you have one that works you can lsinitrd that and compare it to the same on a non-migrated initramfs and see what the differences are and then you can tell dracut what to include (the stuff that's missing!).
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

sponge_bob_128
Posts: 2
Joined: 2017/03/10 23:20:47

Dual Bare Metal and VirtualBox Install Re: CentOS 7 will not boot after migration to Hyper-V

Post by sponge_bob_128 » 2017/03/10 23:39:55

I am having the same trouble as the original poster. In the past, (Centos 6 and before), I could install Centos on the machine and then load the physical partition up in a VirtualBox and Linux was smart enough to boot up and find the basic "virtual" Disk/Network/Graphics drivers and ignore missing real hardware without flipping out and locking up during boot like Centos 7. If I use the "rescue" grub system choice, it boots up. Does anybody know if there is anyway to get this to work, which I guess would require Centos 7 to try to load both bare metal and virtual drivers? And maybe the minimal list of "extra" drivers needed by VirtualBox (No sound/USB/etc.).

User avatar
TrevorH
Forum Moderator
Posts: 29117
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 7 will not boot after migration to Hyper-V

Post by TrevorH » 2017/03/11 00:03:43

Read my previous post.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

sponge_bob_128
Posts: 2
Joined: 2017/03/10 23:20:47

Re: CentOS 7 will not boot after migration to Hyper-V

Post by sponge_bob_128 » 2017/03/11 02:09:14

Is there a way to just tell "dracut" to put in all the drivers like in the past?

"dracut" doc:
If you want to create lighter, smaller initramfs images, you may want to specify the --hostonly or -H option. Using this option, the resulting image will contain only those dracut modules, kernel modules and filesystems, which are needed to boot this specific machine. ... The usage of the --hostonly option is only for experts.
It looks like "Centos 7" has foisted this "expert optimization" on us. I did not have this problem with a previous install of Centos 7.

User avatar
TrevorH
Forum Moderator
Posts: 29117
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 7 will not boot after migration to Hyper-V

Post by TrevorH » 2017/03/11 10:38:22

dracut has always defaulted to hostonly=no but if you want to change it then either pass the right parameter or edit /etc/dracut.conf and change it.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

eduardobaitello
Posts: 1
Joined: 2017/10/06 17:06:53

Re: CentOS 7 will not boot after migration to Hyper-V

Post by eduardobaitello » 2017/10/06 17:10:32

Take a look at this: https://mangolassi.it/topic/8351/updati ... to-hyper-v
I solve may case rebuilding the the initramfs with dracut prior to the migration:

Code: Select all

dracut -f --add-drivers "hv_vmbus hv_storvsc hv_netvsc hv_utils hv_balloon hyperv-keyboard hyperv_fb hid-hyperv"

Post Reply

Return to “CentOS 7 - General Support”