The Open Virtualization Format (OVF) is an open standard for packaging and distributing virtual appliances for the use in virtual machines. An OVA file is a one file alternative to pack a multi file OVF directory. This is a short example how to convert OVA for the use in a proxmox 2.0 KVM environment. The OVA file was exported from the Virtualbox software, where we had build a debian based virtual machine.

Extract the OVA Archive

OVA files are TAR archives with the OVF directory inside.
To extract the archive do

tar -xvf Virtual_Appliance_Debian.ova
=> 
Virtual_Appliance_Debian.ovf
Virtual_Appliance_Debian-disk.vmdk

You get Virtual_Appliance_Debian-disk.vmdk which is a virtual machine disk file. The VMDK file format was developed for the use in VMWare or Virtualbox. It is an open format.

Converting VMDK to RAW and from RAW to qcow2

With the free available software Virtualbox it is possible to convert VMDK disk files to RAW image format.

VBoxManage clonehd --format RAW Virtual_Appliance_Debian-disk.vmdk Virtual_Appliance_Debian-disk.raw
=> Virtual_Appliance_Debian-disk.raw

Convert the RAW image file to qemu format:

qemu-img convert -f raw Virtual_Appliance_Debian-disk.raw -O qcow2  Virtual_Appliance_Debian-disk.qcow2
=> Virtual_Appliance_Debian-disk.qcow2 <br /> ## Use qcow2 files in Proxmox 2.0 The use of an existing qcow2 file in proxmox 2.0 is very easy. Just create a new virtual machine and replace the disk file with the qcow2 file. 
  • create a new KVM virtual machine via the proxmox webinterface.
    • Click Create VM.
    • General: select Node, VM ID and Name.
    • OS: Select the operating system type of your virtual machine.
    • CD/DVD: Do not use any media.
    • Hard Disk: Select existing lvm storage for storage and choose same or better bigger disk size as the original VM disk size.
    • other Tabs: as needed for the new virtual machine.
    • Confirm: Click Finish

Proxmox has created a new disk file for the virtual machine. Do not start the new VM. Replace the proxmox generated qcow2 file with our Virtual_Appliance_Debian-disk.qcow2

mv Virtual_Appliance_Debian-disk.qcow2 /var/lib/vz/images/105/vm-105-disk-1.qcow2

Start the virtual machine via the proxmox webinterface.

Insertion: About Unzipping 7zip files

Sometimes we use 7zip compressed files for easier transportation of disk images.
Install 7zip if not already installed:

sudo apt-get install p7zip

Unzip the 7zip file:

7z x Virtual_Appliance_Debian.ova.7z


see also

external information sources:



blog comments powered by Disqus

Published

02 August 2012

Tags