How to Migrate a Guest Vm From Proxmox to Vmware

Migrating a guest VM from Proxmox to VMWare VSphere requires a few steps detailed below.

Export Image of KVM Guest to VMDK

  1. Ge the Proxmox Guest Config

    qm config 116
    
  2. Get full path to disk

    pvesm path 'main_vm:vm-116-disk-1,size=32G'
    
  3. Convert disk image to VMDK:

    qemu-img convert -f rbd -o vmdk rbd:main/vm-125-disk-0 proxmox-guest-image.vmdk
    

Create Virtual Machine in VSphere

  1. Create a Linux Virtual Machine in VMWare VSphere

Copy and Convert VMDK to Thin Format

  1. Copy over vmdk from Proxmox to VMWare. Copy into the Datastore / directory of your VSphere guest. The actual datastore should be symlinks in /vmfs/volumes/

  2. Convert the image to the thin VMDK format

    vmkfstools -i proxmox-guest-image.vmdk new-disk-0.vmdk -d thin
    
  3. Add Disk as primary disk with scsi0:0 so it boots from it.

Add VMWare Modules into Initrd

In hindsight I should have done this before moving the VM.
The most important would be the VMWare Paravirtual SCSI driver.

  1. Boot the VMWare Guest with the CentOS Rescue ISO. Select Trobuleshooting -> Rescue a CentOS Linux System. Choose 1 to continue when prompted. You will end up with your disks mounted in /mnt/sysimage

  2. Mount the following filesystems into your image:

    mount --bind /proc /mnt/sysimage/proc
    mount --bind /dev /mnt/sysimage/dev
    mount --bind /sys /mnt/sysimage/sys
    mount --bind /run /mnt/sysimage/run
    systemctl start multipathd.service
    
  3. Finally chroot into your system

    chroot /mnt/sysimage
    
  4. Edit the /etc/dracut.conf.d/drivers.conf and add the folloing VMWare Devices

    # /etc/dracut.conf.d/drivers.conf
    add_drivers+="vmw_balloon vmw_vmci vmwgfx vmxnet3 vmw_pvscsi"
    

    I presume the essential piece would be the vmw_pvscsi.

  5. Rebuild your kernel using dracut.

    dracut --verbose --force 
    
    # rebuild for a particluar kernel
    dracut --verbose --force --kver 3.10.0-693.el7.x86_64
    

Launch VMWare Guest

Launch VMWare Guest without the CentOS ISO.

Reference

  1. RHEL Knowledge Base: How can I ensure certain kernel modules are included in the initrd or initramfs in RHEL?
  2. Proxmox to VMWare
  3. Configuring disks to use VMware Paravirtual SCSI (PVSCSI) controllers (1010398)
  4. Migrate qcow2 images from KVM to VMWare
  5. Creating a New Initial RAM Disk