Converting HyperV to ESXi

matkisson

Member
Apr 11, 2017
32
7
8
34
This really is just an FYI post incase anyone searches for an issue like this.

I recently decided to migrate my HyperV infrasture to my ESXi (6.7) server to consolidate my server rack. Including rewiring my entire network. The VM in question is a Plex media server running on RHEL 7.6 on 2012 HyperV. All setting were default when I created the VM, nothing special. I tried to use the VMware converter software but when I booted the VM on the ESX/vSphere server, the VM would fail to detect a bootable VHD and boot the the EFI firmware. After multiple attempts, changing a few options in the HyperV config each time, I decided to think outside the box. I managed to get the VM to boot but it would fail to detect LVMs, despite following the RH solution (Kernel panic on boot following "dracut Warning: LVM rootvg/rootlv not found" - Red Hat Customer Portal).

At this point I was convinced that the conversion was unable to account for some settings.

The final solution:

Convert the HyperV VM to a VMware Workstation export.
Remove all drives from the VM
Add the VMDK as an IDE hard drive.
*For compatability, set the proper guest operating system (RHEL 7 64-bit)
Upgrade VM compatability to Workstation 14/ESXi 6.7
Connect VMware Workstation to the ESXi/vSphere server and upload the VM
On the ESXi/vSphere server, remove the NICs currently on the VM (they are incompatible) and add a new NIC (VMXNET3 preferably)
Power on the VM and expect some services to fail.
Determine the interface name and use NMTUI to add and configure the connection.
REBOOT

This took almost 3 hours for me to figure out but hopefully it helps someone.
 
  • Like
Reactions: mathiastro

msg7086

Active Member
May 2, 2017
407
148
43
35
For migrating Linux servers like this, I'd prefer to bring up rescue CD on both VM, and do a full drive rsync. After files are copied, chroot into the new root and update grub and fstab. It shouldn't take 3 hours. Besides, that's a free file defragmentation.
 

Stephan

Well-Known Member
Apr 21, 2017
640
431
63
Germany
Not sure if rsync copies ACLs or xattrs... Linux has gotten more complicated since the advent of capabilities. Here is my tar-only solution (root and one UEFI boot):

tar --one-file-system --numeric-owner --acls --xattrs --xattrs-include='*' --warning=no-file-ignored --totals -czpSf data.tgz /boot /
(started in /mnt/othervolume)

And back: tar --xattrs --xattrs-include='*' --acls -xvzpf data.tgz -C /root/1

provided your new root+boot is mounted in /root/1/ and /root/1/boot already. If you use PARTUUIDs in /etc/fstab, make sure to run blkid and change the IDs to the new ones. I am only using systemd-boot any more on UEFI systems, so no grub necessary.
 

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,395
509
113
Not sure if rsync copies ACLs or xattrs...
-A to include ACLs, -X to include xattrs. I usually always use -aHAX where you might ordinarily just use -a.

Be warned that since you're using -x/--one-file-system only the root partition would be included, any sub-partitions for /var or /home or whatever would also need to be done.