Import Turnkey Linux VMDK to OpenNebula

These instructions were kindly copy/pasted (with permission - and some minor contextualisation) from Matthias Gasser's Blog. Thanks Matthias! :)

These instructions apply specifically to TKL v12.0 but should equally apply to newer versions too.

TurnKey Linux appliances are available in a number of different formats (vmdk,ISO,OVF,OpenStack,OpenVZ,XEN,EC2), however yet not out of the box usable for OpenNebula + KVM. To bring a TurnKey Linux appliance live on OpenNebula the image has to be converted first:

qemu-img convert turnkey-wordpress-12.0-squeeze-x86.vmdk -O qcow2 turnkey-wordpress-12.0-squeeze-x86.qemu

I choose the QCow2 format as it provides some advantages (compression, snapshots) over raw. After converting the vmdk to a QCow2 type move the image preferably to /tmp as OpenNebula is going to copy the file to the data-store anyway and by leaving it inside a home directory with SELinux enabled the import is likely to fail.

As a last step the image needs to be imported into OpenNebula. This may be done by using the oneimage command or conveniently using the Sunstone web frontend. Just provide the /tmp/.qemu in the “Provide a path” field use “vd” for the device prefix, “qcow2″ for the driver, “vda” for the target. After all just generate a new template naming the new image as a disk, choose x86_64 for the architecture and you’re ready to turn on you key linux appliance. Don’t forget to enable the VNC access as to configure your appliance using the first run script provided by TurnKey Linux.