Procedure to import vmware OVA to Proxmox 5.0-23 with ZFS VM store

ndroftheline

Well-Known Member
Jun 17, 2017
35
18
48
36
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.

  1. 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
  2. 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
  3. 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”
  4. 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
  5. 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
  6. 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
  7. Boot the VM via whatever method you prefer - easiest probably the web UI.
 
  • Like
Reactions: v saravana kumar
step 4->6 : use new "qm importdisk" from proxmox5 ;)

I'll directly read the vmdk and write it to destination storage (zfs, ceph, ...), without intermediate step.
 
check the man page / 'qm help importdisk' - it is pretty straightforward.
 
The manual on qm is fairly explanatory!

this is an example command much like what I used successfully:
qm importdisk 101 PRODUCT_vmware-disk1.vmdk local-zfs

worke dlike a charm :)thanks!
 
I try that and get Configuration file doesn't exist. Any ideas.

What I'm trying to do is take a vmdk from a USB and import it. I tried this command:

Code:
qm importdisk 101 ./localfilethatisWin2k8.vmdk Server2008 -format vmdk

I know that 101 is free, but it errors out for lack of a configuration file. There's not going to be a config file for a VM that doesn't exist yet, right? What am I doing wrong?
 
  • Like
Reactions: philDE
I know that 101 is free, but it errors out for lack of a configuration file. There's not going to be a config file for a VM that doesn't exist yet, right? What am I doing wrong?
with that command you can import a disk to an existing vm not a new one
 
  • Like
Reactions: ekimia
the ID of the storage into which the disk gets imported
 
there is a "qm importovf" which parses an OVF manifest and tries to create a matching PVE VM config. it probably can be improved even further ;)
 
  • Like
Reactions: Caglar Demirtas
Thank you @ndroftheline for the procedure, it really helped me. But .qcow2 didnt work for me .raw worked. i am using proxmox 5.1-41
will be trying qm import disk and post it about it soon
 
Hi
using qm importdisk
I got the following error message

zfs error: cannot create 'rpool/data/vm-110-disk-0': volume size must be a multiple of volume block size

update: got it solved by making the file a multiple of 4096 with
dd if=/dev/zero bs=1 count=what is needed for multiple of 4096 >> file.ova
 
Last edited:
Hi
now the imported disk with qm is not boatable!

the ova file works fine with virtualbox so how to set up the bootable flag?

thanks
 
Any updates to this procedure for latest version of proxmox? Would be nice if this was in the wiki.
 
For anybody looking at this now, it has gotten even easier:

I'll use Turnkey's OpenLDAP .ova image as an example. An .ova file is basically just a tarred tiny .ovf file + disk images. Then use proxmox' "qm importovf" to do all the work. It:
  • Converts the .vmdk disk to qcow2, and installs it in Proxmox with the right name and location
  • Creates a Proxmox virtual machine based on the .ovf file and links in the converted disk image
root@proxmox04:~/ldap# ls -lh
-rw-r--r-- 1 root root 426M Nov 14 15:48 turnkey-openldap-15.1-stretch-amd64.ova

root@proxmox04:~/ldap# tar xf turnkey-openldap-15.1-stretch-amd64.ova

root@proxmox04:~/ldap# ls -lh
total 851M
-rw-r--r-- 1 64 64 426M Jun 24 09:20 turnkey-openldap-15.1-stretch-amd64-disk1.vmdk
-rw-r--r-- 1 64 64 183 Jun 24 09:19 turnkey-openldap-15.1-stretch-amd64.mf
-rw-r--r-- 1 root root 426M Nov 14 15:48 turnkey-openldap-15.1-stretch-amd64.ova
-rw-r--r-- 1 64 64 6.4K Jun 24 09:19 turnkey-openldap-15.1-stretch-amd64.ovf

root@proxmox04:~/ldap# qm importovf $(pvesh get /cluster/nextid) ./turnkey-openldap-15.1-stretch-amd64.ovf ext4 -format qcow2
Formatting '/mnt/ext4/images/171/vm-171-disk-0.qcow2', fmt=qcow2 size=21474836480 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16
(100.00/100%)


And now you have a newly created virtual machine. For some reason the newly created virtual machine didn't have a network card. So I installed one manually, booted and had a working OpenLDAP running.

With two commands. Piece of cake!
 
  • Like
Reactions: Stoiko Ivanov
I only needed one command
qm importovf 999 MyESXvm.ovf local-lvm

As a Windows user (idiot) it went:
1. Download the OVA from wherever it existed
2. Open it in 7zip, remove the OVF and VMDK
3. Use WinSCP to upload the ovf and vmdk to the Proxmox, I chose the root folder.
4. Ran the command above from the console - make sure the naming is correct, both files refer to each other, you can't rename them
5. The VM then appears in your PVE console as 999 and you then should edit the hardware for compatibility. For example, mine came with a SCSI driver that the OVF suggested but the thing coudlnt start so I changed it to one from VMWare and the same for other devices

I'm new to PVE and found this to be q very reasonable process, however, compatibility is a big issue and many of my companies appliances are sold with only ESX OVA format supported so there's limited actual usage until this is a lot more supportable.
 
  • Like
Reactions: Dominic
I'm new to PVE and found this to be q very reasonable process,
Great to hear that it worked so smooth for you!

compatibility is a big issue and many of my companies appliances are sold with only ESX OVA format supported so there's limited actual usage until this is a lot more supportable.
You mean OVAs that are a single file? Supporting that is on our roadmap.

Note that there is also a wiki article about migrations https://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!