2

I converted a vmdk image file to qcow2 with qemu-img (on a ubuntu 14.04 server)

sudo qemu-img convert -f vmdk -O qcow2 Odoo-disk1.vmdk odoo-disk1.qcow2

now, the resulting qcow2 image is more then twice as big as the original.

$ ls -lh
-rwxrwxrwx 1 root root 3.3G Nov 20 14:46 Odoo-disk1.vmdk
-rwxrwxrwx 1 root root 7.4G Nov 21 14:35 odoo-disk1.qcow2

Not really sure what to think of this but I would be much more relaxed whether the files where similar in size. Is there any way to achieve that? I am not very experience with this matter, so any explanation why that just 'is like that' would also be helpful

I set up the VM using this qcow 2 image and after started it virsh list --all shows the machine as 'running'.

vrms
  • 541

2 Answers2

1

It is possible that your vmdk was compressed or that you did not create a qcow2 file at all. If you convert normally with qemu-img convert some.vmdk some.qcow2, you would get a raw file.

To convert from a vmdk file to a compressed qcow2 file, try:

qemu-img convert -O qcow2 -c some.vmdk some.qcow2
Lekensteyn
  • 178,446
0

My guess is the vmdk is sparse or compressed. Qcow2 supports sparse images too.

You could try tweaking the -s (sparse size) argument to see if it's the sparseness.

You could also try mounting and defragging the new qcow2 image and re-converting to try and put all the empty space back to back and filling it with zeros as recommended here, so the sparseness parameter isn't an issue, if it's a filesystem that supports that sort of thing.

Just a couple of options

RobotHumans
  • 30,112