kvm to vmware migration - lvm based guest + multipathing

6,351

Solution 1

VMware converter can migrate from any source machine regardless of the source type. (virtual/physical/KVM/Hyper-V) The only trouble is VMware converter can't migrate software RAID or LVM. So the solution for this is to create a skeleton server with the bare minimum of the source machine and push everything with the tar command from the source server.

I had to use this solution, when I was migrating quite a few racks bare metal server to VMware and some had softraid or LVM installed.

Steps to follow for this:

1: Create your target vm box

2: Install a minimum version of the same system that your source has (network, ssh server and tar must be available)

3: Create a list of directorys we don't want to include

boot proc dev sys etc/fstab etc/lvm etc/blkid mnt/yourexternalhdd

save it under /tmp/nocopy

4: Take a snapshot of your target in case something goes wrong

5: SSH to your source and as root: cd /; tar -zcvpf - -X /tmp/nocopy * |ssh target "cd /; tar -zxvpf - --numeric-owner" 6: Reset target.

E.G.:

tar -zcvpf - -X /tmp/nocopy * | ssh [email protected] "cd /; tar -zxvpf - --numeric-owner"

Solution 2

In order to convert the existing disk images to VMware’s vmdk format you should you use the program qemu-img from the package qemu-utils (in Ubuntu).

The process is straight-forward

sudo qemu-img convert -p -i DiskImage.img -O vmdk DiskImage.vmdk

vmkfstools -i /vmfs/volumes/nfs1/DiskImage.vmdk -d thin /vmfs/volumes/datastore1/MyServer/DiskImage.vmdk

Transfer disk image to ESXi (using scp (enable ssh in ESXi)) or NFS

Create new virtual machine with custom options and add the converted disk

Boot

Share:
6,351

Related videos on Youtube

joe33
Author by

joe33

Updated on September 18, 2022

Comments

  • joe33
    joe33 almost 2 years

    What is recommended way of migrate from kvm to vmware in case of lvm based guest with multipathing? I found that similar questions were already asked few years ago:

    How to migrate KVM based VMs running in LVM setup to Vmdk images

    converting KVM virtual machines to VMware-vsphere

    But the problem with vCenter converter is that base on documentation linux volumes mounted by device mapper multipath aren't supported. What is currently the proper way to proceed in case of multipath environment?

  • Laz
    Laz over 4 years
    Some extra updates regarding to XEN based source hosts. I had some trouble on Windows host where I could not pull down the source machine because few of them got stock at different percentage. The trouble was caused by the XEN tools. It installs VSS provider for the host and this interferes with the Windows VSS obviously and causing trouble to migrate the machine. So the best thing if you stuck at some point migrating a XEN based Windows machine is to get rid of the XEN tools from the source box.