4 qemu_migration
bucde edited this page 2022-10-21 08:13:41 +00:00

QEMU VM migration

Migrate a VM from VMware ESXi to Proxmox VE

Copy .vmdk from VMware ESXi to Proxmox VE via SCP

Find the .vmdk files corresponding to the VM to migrate. They should be located in /vmfs/volumes/ on the VMware ESXi machine.

To establishe outgoing SSH connection you need to allow it in the firewall.

With executing esxcli network firewall ruleset set --enabled=true --ruleset-id=sshClient inside the shell from the VMware ESXi machine you can do that.

If you want, you can check SSH connection to your Proxmox VE machine with ssh root@<PROXMOXVE_IP_ADDRESS>.

Now you can copy the .vmdk files from the VMware ESXi machine with scp -r <PATH_TO_VMDK_FILES>/* root@<PROXMOXVE_IP_ADDRESS>:<PATH_AT_PROXMOXVE>. This can take a very long time!

Migrate .vmdk to ZVOL

First you have to identify the exact size of the .vmdk disk with qemu-img info <PATH_TO_VMDK_FILE>. The output should look like this:

image: <PATH_TO_VMDK_FILE>
file format: raw
virtual size: 3.63 TiB (3991227208704 bytes)
disk size: 1.53 TiB

With the virtual size in bytes (here 3991227208704) you have to create a new ZVOL as described here.

🔴 TODO: add information about naming of ZVOLs and VM naming information

Now the .vmdk file must be migrated to the created ZVOL with qemu-img convert -p -f vmdk -O raw <PATH_TO_VMDK_FILE> <PATH_TO_ZVOL>.

  • -p display a progress bar
  • -f vmdk set the input image format to vmdk
  • -O raw set the output image format to raw
  • <PATH_TO_VMDK_FILE> path to the input vmdk file
  • <PATH_TO_ZVOL> path to the output ZVOL (/dev/zvol/<POOLNAME>/<ZVOLNAME>)

🔴 TODO: add information about choosing the right .vmdk files