vmdk disk on kvm

Issues related to applications and software problems
Post Reply
luke2014
Posts: 13
Joined: 2014/04/17 13:15:28

vmdk disk on kvm

Post by luke2014 » 2014/04/22 17:11:09

I would like to use a vmdk disk image (containing an old TurnKeyLinux installation) as a nested image in a centos guest.

I can use this image directly using virt-manager in my host machine (Ubuntu 14.04). I also converted the image from vmdk to qcow2 and this image works fine on my host machine.

When I try these images in the centos installation (6.5) I get the following errors:
Using qcow2:

Code: Select all

Error starting domain: internal error Process exited while reading console log output: char device redirected to /dev/pts/0
qemu-kvm: -drive file=/var/lib/libvirt/images/TurnKeyMySQL20120413-disk1.qcow2,if=none,id=drive-ide0-0-0,format=qcow2: 'drive-ide0-0-0' uses a qcow2 feature which is not supported by this qemu version: QCOW version 3
qemu-kvm: -drive file=/var/lib/libvirt/images/TurnKeyMySQL20120413-disk1.qcow2,if=none,id=drive-ide0-0-0,format=qcow2: could not open disk image /var/lib/libvirt/images/TurnKeyMySQL20120413-disk1.qcow2: Operation not supported
Using vmdk: I can use it only in read-only mode. And the machine stops at boot time.

Why I cannot use the original vmdk image?

LuKe

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: vmdk disk on kvm

Post by Super Jamie » 2014/04/23 12:52:18

The virtualization included within EL6 is an older version than brand-new Fedora or Ubuntu will have.

The feature to use vmdk was added some time in the last few years, and probably is not possible to backport to EL6's old qemu-kvm version.

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: vmdk disk on kvm

Post by TrevorH » 2014/04/23 15:38:33

The rpm changelog for qemu-kvm says it contains support

Code: Select all

$ rpm -q --changelog qemu-kvm | grep -i vmdk
...
  ([RHEL-6.5] Backport support for vmdk image format)
...
$ rpm -q  qemu-kvm
qemu-kvm-0.12.1.2-2.415.el6_5.5.x86_64
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
MindfulCoyote
Posts: 2
Joined: 2014/05/23 00:33:19

Re: vmdk disk on kvm

Post by MindfulCoyote » 2014/05/23 04:13:34

As Super Jamie wrote, qemu-kvm on Centos 6.5 is an earlier version than Ubuntu 14.04:

Centos 6.5# /usr/libexec/qemu-kvm --version
QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard

Ubuntu 14.04# qemu --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1), Copyright (c) 2003-2008 Fabrice Bellard

The error you posted indicates that you converted the vmdk to a later version than is supported on the Centos box.
[...] uses a qcow2 feature which is not supported by this qemu version: QCOW version 3 [...]

The solution I used to workaround this issue is to convert the vmdk image using backwards copmatability mode:
-o compat=0.10

In your case, this command should work:
qemu-img convert -o compat=0.10 -f vmdk -O qcow2 -c -p TurnKeyMySQL20120413-disk1.vmdk TurnKeyMySQL20120413-disk1.qcow2

You can verify the compatability of the qcow2 file with this command:
qemu-img info TurnKeyMySQL20120413-disk1.qcow2

(Running that same command against the original vmdk might lend some insight as to the why it doesn't work. Most likely it is also a newer version than the Centos qemu-kvm supports.)

Post Reply