[SOLVED] Problem boot CentOS after migration from VMWare to Hyper-V

General support questions
frinks
Posts: 14
Joined: 2009/10/19 17:49:02

[SOLVED] Problem boot CentOS after migration from VMWare to Hyper-V

Post by frinks » 2019/11/28 17:18:49

Hello all,

having a problem, on booting a VM after converting a CentOS 7 from VMWare to Hyper-V.
After googling, I try to convert the machine a second time after installing HV drivers on the guest machine, and recreate a initrd inside VMWare before converting it again, with no luck.

After that try to boot from a CentOS Rescue, and mounted the filesystem "chroot /mnt/sysimage" and
I can see there are 2 partitions inside the disk (fdisk -l):
/dev/sda1 (*boot)
/dev/sda2 (data), but I only have one VHDX.

Tryed to run the command (dracut -f), but the machine does not boot either, so I'm stuck...

Any help will be much appreciated.

Thank you.
Last edited by frinks on 2019/12/05 10:45:12, edited 1 time in total.

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

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by TrevorH » 2019/11/28 17:33:13

Does it boot if you select the rescue kernel from the grub menu?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

frinks
Posts: 14
Joined: 2009/10/19 17:49:02

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by frinks » 2019/11/28 17:47:44

Hi,

On boot the vm does not present any grub menu, and i don't receive any error, just the information to boot from PXE or NetworkCard.
Appears that the VM as no disk attached.

I can boot from dvd, and see the disk after mount it with chroot /mnt/sysimage, so I tought this as to do with boot partition is not being seen by the Hypervisor.

The "Secure Boot is disabled", and the disk controller is SCSI (Hyper-V v2), and I tryed also attach the VHDX on a IDE controller, but in VMWare was SCSi.

Thank you

BShT
Posts: 116
Joined: 2019/10/09 12:31:40

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by BShT » 2019/11/28 17:53:20

according to

https://docs.microsoft.com/en-us/previo ... dfrom=MSDN

You must uninstall VMware Tools on the guest operating system of the virtual machine

frinks
Posts: 14
Joined: 2009/10/19 17:49:02

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by frinks » 2019/11/28 18:06:35

Is not installed.

This was the command to update initrd:
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)

BShT
Posts: 116
Joined: 2019/10/09 12:31:40

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by BShT » 2019/11/28 18:50:56

well... i can help you to migrate VMs to vmware from Xen and KVM...

i know nothing about Hyper-V

a fresh install?

frinks
Posts: 14
Joined: 2009/10/19 17:49:02

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by frinks » 2019/11/28 19:26:02

Hi,

well I have 2 machines (APP and Oracle DB), so I was hopping to convert only.
Fresh install will have to deal with other costs... and time.

I can't understand, why i converted other distros of linux with no problem, and this I can't convert.
:/

thank you

dunch
Posts: 65
Joined: 2018/11/07 13:48:53
Location: Yorkshire

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by dunch » 2019/11/29 08:14:25

HyperV is a bit odd. The VMs don't look like PCs, there's no PCIe bus and all the devices are MS specific and the Gen2 EFI implementation is a bit quirky.
However, I successfully migrated our setup from VMWare to HyperV a year or two ago, everything I did has already been mentioned above but from memory:
  • Uninstall VMWare tools before migration.
    Run the conversion utility and migrate the VM.
    Bring the VM up in HyperV in single user mode and rebuild the initramfs.
    Boot normally.
You will probably have to muck about with your NIC names in /etc/sysconfig/network-scripts because systemd-udev doesn't know about MS NICs and doesn't rename them.

dunch
Posts: 65
Joined: 2018/11/07 13:48:53
Location: Yorkshire

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by dunch » 2019/11/29 08:18:12

Btw, rebuilding the initramfs is the most important thing. Because HyperV VMs use the MS bus and devices, the necessary drivers are not present in the initramfs you have on your VMWare systems. Rebuilding initramfs in single user mode will autodetect the drivers and add them.

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

Re: Problem boot CentOS after migration from VMWare to Hyper-V

Post by TrevorH » 2019/11/29 15:44:13

If you never see the grub menu then something much more serious has gone wrong. The initramfs is processed several computer-years after grub has stepped out of the loop. If grub doesn't load then that's not initramfs related, it's something to do with the cloning of the disk or the "hardware" being emulated.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”