1

Hy everyone,

the search function does not come up with a propper solution. I want to convert a old KVM disk QCOW2 to an compatible Ctrix Xen disk e.g. VMDK with that qemu-img converting tool

qemu-img convert -f qcow2 -O vmdk /mnt/itstuff/disk.qcow2 /mnt/itstuff/disk_conv.vmdk

but this is not working for me. I got the following error:

qemu-img: Could not open '/mnt/itstuff/disk.qcow2': Invalid argument qemu-img: Could not open '/mnt/itstuff/disk.qcow2'

Any ideas?

regards Thomas

rcpe
  • 11
  • 2

1 Answers1

0

Assuming your source file is present, accessible and not currently used by a running VM, the problem can be due to the source file not being a valid Qcow2 one (ie: maybe it is a raw file with a wrong .qcow2 extension)

Try omitting the source format parameter, issuing qemu-img convert -O vmdk /mnt/itstuff/disk.qcow2 /mnt/itstuff/disk_conv.vmdk

If that does not work, please provide additional information by issuing qemu-img info /mnt/itstuff/disk.qcow2

shodanshok
  • 44,038
  • 6
  • 98
  • 162
  • Thanks for your help. File is present, accessible and a copy of that VM (so its not used). I tried your suggestion "qemu-img convert -O vmdk /mnt/itstuff/disk.qcow2 /mnt/itstuff/disk_conv.vmdk qemu-img: error while writing sector 16384: Invalid argument – rcpe May 13 '19 at 10:41
  • root@kvm01:/mnt/itstuff# qemu-img info /mnt/itstuff/disk.qcow2 image: /mnt/itstuff/disk.qcow2 file format: raw virtual size: 10G (10737418240 bytes) disk size: 10G – rcpe May 13 '19 at 10:44
  • Ah I changed the writing path to a local one. Now its running. I´ll keep you updated. Thanks for the help so far :) – rcpe May 13 '19 at 10:53
  • @rcpe so your `qemu-img info` shows you are dealing with a raw file, rather than a qcow2 one. – shodanshok May 13 '19 at 11:03
  • Thanks this helped out. – rcpe May 14 '19 at 11:05
  • @rcpe if so, please mark the answer as accepted. Thanks. – shodanshok May 14 '19 at 14:11
  • I would, but I dont know how to do it :) – rcpe May 16 '19 at 06:07
  • @rcpe well, it is quite simple ;) just click the up arrow left to the the reply to upvote, then click on the "check" symbol just under the down arrow. – shodanshok May 16 '19 at 06:44