qemu-img error and version madness

The Ubuntu Precise 12.04 qemu version is fairly “outdated” stopping at around 1.0. The current qemu release candiate is 1.3.0.rc2 . So if you are running into a qemu-img: error while reading sector 131072: Invalid argument error while converting images using qemu-img, just try to update your qemu binaries, by the provided source files of qemu.org. #Dependencies apt-get install libglib2.0-dev dh-autoreconf #untar tar xvfj qemu-1.3.0-rc1.tar.bz2 cd qemu-1.3.0-rc1 #configure ./configure ./make ./make install The binaries will be under /usr/local/bin/qemu-img So just for the sake of converting a full path to the qemu-img will do the trick: /usr/local/bin/qemu-img convert disk1.vmdk -O qcow2...

Import Turnkey Linux VMDK to OpenNebula

TurnKey Linux provides 100+ free ready-to-use appliances. They provide an appliance in 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/<imageName>.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...