qemu-img not working correctly with vmdk file (since PVE3.2)

Patschi

Member
Jul 23, 2013
51
0
6
29
Austria
pkern.at
Since Proxmox 3.2 converting the vmdk file to qcow2 format isn't working correctly anymore...

root@server:~# qemu-img convert -f vmdk disk1.vmdk -O qcow2 vm-200-disk-1.qcow2
qemu-img: 'image' uses a vmdk feature which is not supported by this qemu version: VMDK version 3
qemu-img: Could not open 'disk1.vmdk': Could not open 'disk1.vmdk': Wrong medium type
qemu-img: Could not open 'disk1.vmdk'

With 1.4.2 it seems to work.
 
how did you create the vmdk file originally?
 
which one? provide a link.

Hey Tom.

I just stumbled upon the same issue... Trying to import a VMWare appliance (MusicBrainz mirror server) onto proxmox...

I guess if you want to try, give this a shot:

The OVA is available at:

ftp://mayhemchaos.org/pub/musicbrainz/vm/musicbrainz-server-vmware-2013-10-14.ova

After I extracted the 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk' file, I try to convert it to qcow2 with the following command:

qemu-img convert -O qcow2 musicbrainz-server-vmware-2013-10-14-disk1.vmdk vm-103-disk-1.qcow2

But I get

emu-img: 'image' uses a vmdk feature which is not supported by this qemu version: VMDK version 3
qemu-img: Could not open 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk': Could not open 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk': Wrong medium type
qemu-img: Could not open 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk'

Funny MusicBrainz being opensource doesnt have Qemu images or other OSS formats (Vbox & VMWare only..) Go figure! ;)
 
Hi,

vmdk3 is only supported in comming qemu 2.0.


But maybe can you try this script:

http://carlos-spitzer.com/2013/12/2...3-images-to-qcow2-even-when-qemu-img-fails-o/

Already tried, I get

Code:
root@proxmox:/var/lib/vz/template/qemu# ./conv.sh musicbrainz-server-vmware-2013-10-14-disk1.vmdk
musicbrainz-server-vmware-2013-10-14-disk1.vmdk is VMDK3.n Patching to VMDK2.n Run this script again when you're done to patch it back.
[B]dd: invalid status flag: `none'[/B]
Try `dd --help' for more information.

the script has this in it:
Code:
#!/bin/bash
VMDK=$1
FULLSIZE=`stat -c%s "$VMDK"`
VMDKFOOTER=$[$FULLSIZE - 0x400]
VMDKFOOTERVER=$[$VMDKFOOTER + 4]

case "`xxd -ps -s $VMDKFOOTERVER -l 1 "$VMDK"`" in
  03)
    echo -e "$VMDK is VMDK3.n Patching to VMDK2.n Run this script again when you're done to patch it back."
    echo -en 'x02' | dd conv=notrunc status=none oflag=seek_bytes seek=$[VMDKFOOTERVER] of="$VMDK"
    ;;
  02)
    echo "File is VMDK2. Patching to VMDK3."
    echo -en 'x03' | dd conv=notrunc status=none oflag=seek_bytes seek=$[VMDKFOOTERVER] of="$VMDK"
    ;;
  default)
    echo "$VMDK is not VMDK3 or patched-VMDK3.n"
  ;;
esac

I have tried with 'none' between quotes, not working.. I have even removed the argument 'status=none' and ran the script once more, this time it complained

dd: invalid output flag: `seek_bytes'

Seems everything XXXX=YYYY is not passed to dd properly, or proxmox ships with a different version of dd ??


EDIT: I tried performing the dd operation from another computer. DD didnt' output any errors so I assumed the script of 'carlos-spitzer' worked, then I scp'd the vmdk file to proxmox, and tried to re-convert the image from vmdk to qcow2 with the exact same command as I documented above, but it failed once again with:

root@proxmox:/var/lib/vz/template/qemu# qemu-img convert -O qcow2 musicbrainz-server-vmware-2013-10-14-disk1.vmdk vm-103-disk-1.qcow2
qemu-img: 'image' uses a vmdk feature which is not supported by this qemu version: VMDK version 3
qemu-img: Could not open 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk': Could not open 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk': Wrong medium type
qemu-img: Could not open 'musicbrainz-server-vmware-2013-10-14-disk1.vmdk'

So I guess the script to convert VMDK from V3 to V2 or vice-versa doesnt work at all!
 
Last edited:
which one? provide a link.

Sorry, but I don't want to share the .ova file with the public, because it's a sort of an evalution-version of an Firewall and it's not allowed to share it freely. May I send you the link to the file via PM?

I just can say, that on a PVE setup from a friend without subscription it's possible to convert, but not on my system with subscription (PVE 3.2) and that's a bit annoying.
 
Sorry, but I don't want to share the .ova file with the public, because it's a sort of an evalution-version of an Firewall and it's not allowed to share it freely. May I send you the link to the file via PM?

I just can say, that on a PVE setup from a friend without subscription it's possible to convert, but not on my system with subscription (PVE 3.2) and that's a bit annoying.

compare packages on these systems (pveversion -v): if it works on your friends box its very unlikely that it cannot work on your box.
 
Well, the version of qemu ist different...

My version:
root@pve:~# pveversion -v
proxmox-ve-2.6.32: 3.2-121 (running kernel: 2.6.32-27-pve)
pve-manager: 3.2-1 (running version: 3.2-1/1933730b)
pve-kernel-2.6.32-27-pve: 2.6.32-121
pve-kernel-2.6.32-26-pve: 2.6.32-114
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.5-1
pve-cluster: 3.0-12
qemu-server: 3.1-15
pve-firmware: 1.1-2
libpve-common-perl: 3.0-14
libpve-access-control: 3.0-11
libpve-storage-perl: 3.0-19
pve-libspice-server1: 0.12.4-3
vncterm: 1.1-6
vzctl: 4.0-1pve4
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.7-4
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.2-1

Friends version:
root@srv1 ~ # pveversion -v
proxmox-ve-2.6.32: 3.1-114 (running kernel: 2.6.32-26-pve)
pve-manager: 3.1-24 (running version: 3.1-24/060bd5a6)
pve-kernel-2.6.32-26-pve: 2.6.32-114
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.0-2
pve-cluster: 3.0-8
qemu-server: 3.1-8
pve-firmware: 1.0-23
libpve-common-perl: 3.0-9
libpve-access-control: 3.0-8
libpve-storage-perl: 3.0-18
pve-libspice-server1: 0.12.4-2
vncterm: 1.1-6
vzctl: 4.0-1pve4
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.4-17
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.1-1
 
both boxes are not up2date. update both and test again.
 
Oh, right. Updated it now, but still not working on my server:
# qemu-img convert -f vmdk XCSv-disk1.vmdk -O qcow2 vm-200-disk-1.qcow2
qemu-img: 'image' uses a vmdk feature which is not supported by this qemu version: VMDK version 3
qemu-img: Could not open 'XCSv-disk1.vmdk': Could not open 'XCSv-disk1.vmdk': Wrong medium type
qemu-img: Could not open 'XCSv-disk1.vmdk'

Version:
root@pkern:~/test# pveversion -v
proxmox-ve-2.6.32: 3.2-124 (running kernel: 2.6.32-27-pve)
pve-manager: 3.2-2 (running version: 3.2-2/82599a65)
pve-kernel-2.6.32-27-pve: 2.6.32-121
pve-kernel-2.6.32-28-pve: 2.6.32-124
pve-kernel-2.6.32-26-pve: 2.6.32-114
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.5-1
pve-cluster: 3.0-12
qemu-server: 3.1-15
pve-firmware: 1.1-2
libpve-common-perl: 3.0-14
libpve-access-control: 3.0-11
libpve-storage-perl: 3.0-19
pve-libspice-server1: 0.12.4-3
vncterm: 1.1-6
vzctl: 4.0-1pve5
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.7-6
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.2-1
 
Still not working. The original qemu-utils from the official Debian Wheezy repository does work:
https://packages.debian.org/wheezy/qemu-utils

This helped me. I was able to download the deb from https://packages.debian.org/wheezy-backports/amd64/qemu-utils/download, extract it to some arbitrary location & run the qemu-img binary from there:

Code:
# wget http://ftp.us.debian.org/debian/pool/main/q/qemu/qemu-utils_2.0.0+dfsg-4~bpo70+1_amd64.deb
# dpkg -c qemu-utils_2.0.0+dfsg-4~bpo70+1_amd64.deb
drwxr-xr-x root/root         0 2014-05-05 12:27 ./
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/bin/
-rwxr-xr-x root/root    863976 2014-05-05 12:27 ./usr/bin/qemu-img
-rwxr-xr-x root/root    843912 2014-05-05 12:27 ./usr/bin/qemu-io
-rwxr-xr-x root/root    839976 2014-05-05 12:27 ./usr/bin/qemu-nbd
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/sbin/
-rwxr-xr-x root/root      4841 2014-04-30 00:22 ./usr/sbin/qemu-make-debian-root
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/share/
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/share/doc/
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/share/doc/qemu-utils/
-rw-r--r-- root/root     11054 2014-05-05 11:59 ./usr/share/doc/qemu-utils/copyright
-rw-r--r-- root/root       521 2014-04-05 05:04 ./usr/share/doc/qemu-utils/README.Debian
-rw-r--r-- root/root     30616 2014-05-05 12:16 ./usr/share/doc/qemu-utils/changelog.Debian.gz
-rw-r--r-- root/root      9030 2014-04-14 04:26 ./usr/share/doc/qemu-utils/changelog.gz
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/share/man/
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/share/man/man8/
-rw-r--r-- root/root       677 2014-05-05 12:27 ./usr/share/man/man8/qemu-make-debian-root.8.gz
-rw-r--r-- root/root      2380 2014-05-05 12:27 ./usr/share/man/man8/qemu-nbd.8.gz
drwxr-xr-x root/root         0 2014-05-05 12:27 ./usr/share/man/man1/
-rw-r--r-- root/root      8698 2014-05-05 12:27 ./usr/share/man/man1/qemu-img.1.gz
-rw-r--r-- root/root       675 2014-05-05 12:27 ./usr/share/man/man1/qemu-io.1.gz
# mkdir /root/test
# dpkg -x qemu-utils_2.0.0+dfsg-4~bpo70+1_amd64.deb /root/test/

From there I could run /root/test/usr/bin/qemu-img fine.
 
same problem here,
ova imorted smoothly into virtualbox. i had to use a debian/ubuntu original qemu-img binary to convert the disk image.
it would be a nice (maybe enterprise relevant feature) to directly import vmware files into proxmox. i dont mind using the console if it works, but others may like the usability improvement.
 

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!