Hey all, sorry for the super specific title but I thought it would be worthwhile to put together a handful of commands I got from various places on the forum to do this specific thing that I think may be fairly common: importing a vmware OVA to Proxmox 5. There are heaps of guides out there on forums and blogs, but they're mostly about older versions of Proxmox where you could just copy a raw or qcow2(?) image directly to a specific directory, give it a name, and that would be the VM's drive. That's not how it works on Proxmox 5.0 with ZFS, at least that's what I discovered. So these are the steps I used, I hope this helps and this is the right place to post.
- Download the OVA to the proxmox host - this can go anywhere, such as a sudo or root user's home directory
- scp _user_@_source.machine.name:/download/directory/PRODUCT_vmware.ova /destination/directory/
- now cd to your destination directory
- Untar the OVA - an ova is just a config file tarred along with images of the disks of the virtual machine. The config file is configured to be readable by the specific virtualization system it's being installed on. The disk images are just disk images.
- tar xvf PRODUCT_vmware.ova
- Now configure a VM to the exact specs in the ova config file, such as number of processors and ram size and stuff. To see what the OVA would have configured the machine(s) with:
- cat PRODUCT_vmware.ovf | grep -e “Memory RAMSize” -e “CPU count” -e “Netw” -e “Disk”
- Convert the vmdk(s) to qcow2 format, the native format pve uses for disk images. I think you can also skip this if you have the tools available to directly mount the vmdk to perform the later dd command. NOT recommended to follow guides suggesting a RAW copy as this can create a much larger resulting disk than is necessary.
- qemu-img convert -f vmdk PRODUCT_vmware-disk1.vmdk -O qcow2 PRODUCT_vmware-disk1.qcow2
- Mount the qcow2 disk using the qemu Disk Network Block Device Server - this just makes it easy to dd the used bytes.
- qemu-nbd -c /dev/nbd0 PRODUCT_vmware-disk1.qcow2
- dd (or whatever else bitstream you prefer) the contents of the disk to the (stopped) VM's disk. NOTE: you'll have to establish the correct VM number based on its ID in proxmox.
- dd if=/dev/nbd0 of=/dev/zvol/rpool/data/vm-107-disk-1 bs=1M
- Boot the VM via whatever method you prefer - easiest probably the web UI.