MARWAN docs NOC knowledge base
DocsVirtualization

Migrate from VMware to Proxmox

Why and how MARWAN moved its virtual machines from VMware to Proxmox VE with Ceph, and how to prepare the migration.

Updated Sami Ait Ali Oulahcen

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 make its storage spreaded across multiple VMDK disks. Which makes the migration a bit slower.

So before migrating, we recommend removing 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 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.

::: warning CPU type for RHEL like systems In VM hardware options you'll need to choose "host" as processor type for Alma/Rocky Linux otherwise you'll get a kernel panic. (still the case at the time of writing, Feb 2023) :::

After that, 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**

Now go to options, choose sata as type then attach drive.
Then go to hardware and choose disk as boot option.
Finally start the machine.
If you want to add the VM to HA, you can head 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