Migrate from VMware to Proxmox
0. Why the switch to Proxmox
With VMware charging huge $$$ for its licences, and even upgrading costing as much as acquiring a new licence, we started looking into alternatives. Nutanix wasn’t much better price wise, altough very apealing with its all inclusive model.
So we turned to opensource, and the most viable contenders were oVirt and Proxmox. We favoured oVirt at first because of a preference for RHEL like systems. oVirst is mostly shepherded by Red Hat and looking into the development roadmap, it seemed Red Hat was mostly focused on its flagship cloud platform OpenShift. So the future of oVirt development seemed unclear. Plus we really wanted to go for Ceph as storage, and at the time of writing (Feb 2023), Ceph is still not natively supported in oVirt.
Proxmox stood up as the perfect choice, opensource, native support for Ceph, and as an added bonus it comes with its own backup solution: PBS !
1. Preparing for migration
Backup, backup, backup !
Altough the migration shouldn’t have any impact on your existing infrastructure. In the spirit of always having a backup and a rollback plan, let’s make sure our VMs are backed up before proceeding.
Existing snapshots
Existing snapshots of a virtual machine on VMware will have the VM’s disk spreaded across multiple VMDKs. Which makes the migration a bit slower.
So before migrating, it’s recommended to remove all VM snapshots. Then proceed.
Drivers
Most drivers needed for Proxmox are already present in the Linux kernel. But for RHEL like systems like Rocky or Alma Linux, you need to run these commands:
yum install qemu-guest-agent
dracut --force --add-drivers "virtio_balloon virtio_scsi virtio_console virtio_net virtio_pci"
For Windows you can install the virtIO drivers via CDROM.
2. Starting the migration
Shuting down the source VM and copying disks
First shutdown the VM you want to migrate. Then we will copy the VMDK disks from VMware ESXi to Proxmox. If you followed the previous advice about snapshots, you should only have two disks machine.vmdk
and machine-flat.vmdk
. It’s recommended to scp
from the console or using screen to avoid interuptions. This will take a while depending on your connection and disks speed. Your scp
commands would look like this:
scp user@esx5.mydomain.ma:/vmfs/volumes/prod-volume/vm.mydomain.ma/vm.mydomain.ma.vmdk /mnt/pve/cephfs/vcenter/
scp user@esx5.mydomain.ma:/vmfs/volumes/prod-volume/vm.mydomain.ma/vm.mydomain.ma-flat.vmdk /mnt/pve/cephfs/vcenter/
Note: Some machines have non similar disk names. In that case connect to vCenter or the ESXi containing the VM, and in VM settings you can see which disk is actually attached to the VM.
Importing & attaching disks to VM with same specs in Proxmox
You can now procced to create a similar machine in proxmox and remember its VMID.
Notes on rocky linux 9: In VM hardware options you have to choose “host” as processor type otherwise you get a kernel panic.
After that, we’ll import the disk to the newly created machine:
qm importdisk 103 /mnt/pve/cephfs/vcenter/vm.mydomain.ma.vmdk your-ceph-pool --format qcow2 ##**replace 103 with the above VMID**
Go to options, choose sata as type then attach drive.
Go to hardware choose disk as boot option.
Finally start the machine.
If you want to add the VM to HA, go to “more” on the top menu, and click “manage HA”.
3. Important update
As of 2024, Proxmox has introduced an import wizard for ESXi, you might wanna check it out: Proxmox VE Import Wizard: How to import VMs from VMware ESXi