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
-
Ge the Proxmox Guest Config
qm config 116
-
Get full path to disk
pvesm path 'main_vm:vm-116-disk-1,size=32G'
-
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
- Create a Linux Virtual Machine in VMWare VSphere
Copy and Convert VMDK to Thin Format
-
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/
-
Convert the image to the thin VMDK format
vmkfstools -i proxmox-guest-image.vmdk new-disk-0.vmdk -d thin
-
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.
-
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
-
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
-
Finally chroot into your system
chroot /mnt/sysimage
-
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
. -
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.