Re: [Libguestfs] [libguestfs/virt-v2v] failed to parse ova (#6)
On Wed, Apr 21, 2021 at 12:14:09AM -0700, Étienne BERSAC wrote:
Hi,
I'm migrating from virt-convert to virt-v2v. I encounter the following error :
$ virt-v2v -v -x -i ova cornac.ova -o libvirt virt-v2v: virt-v2v 1.43.5 (x86_64) libvirt version: 7.0.0 [ 0.0] Opening the source -i ova cornac.ova qemu-img info json:'{ "file": { "driver": "raw", "offset": 512, "size": 512, "file": { "filename": "/tmp/v2vqemuimgtst110010.img" } } }' >/dev/null qemu-img supports "offset" and "size" in json URLs: true libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: trace: get_backend libguestfs: trace: get_backend = "direct" tar -tf 'cornac.ova' tar -xf 'cornac.ova' -C '/var/tmp/ova.b0jm2D' 'cornac.ovf' ova: testing if cornac-sda.vmdk exists in cornac.ova ova: file exists tar tRvf 'cornac.ova' libguestfs: trace: close libguestfs: closing guestfs handle 0x55c1f751e7b0 (state 0) virt-v2v: error: failed to parse line returned by tar: "bloc 0 : -rw-r--r-- bersace/bersace 3702 2020-11-12 15:16 cornac.ovf"
Interesting - I suspect this is an issue with the presumably French locale. The output of tar changes and we cannot parse it: $ LANG=fr_FR tar tRvf /mnt/scratch/libguestfs-1.45.5.tar.gz | head -2 bloc 2 : drwxr-xr-x rjones/rjones 0 2021-04-09 11:37 libguestfs-1.45.5/ bloc 5 : -rw-rw-r-- rjones/rjones 26530 2020-03-06 19:31 libguestfs-1.45.5/COPYING.LIB $ LANG=en_GB tar tRvf /mnt/scratch/libguestfs-1.45.5.tar.gz | head -2 block 2: drwxr-xr-x rjones/rjones 0 2021-04-09 11:37 libguestfs-1.45.5/ block 5: -rw-rw-r-- rjones/rjones 26530 2020-03-06 19:31 libguestfs-1.45.5/COPYING.LIB This is a bug in both virt-v2v and nbdkit, but should be easy to fix. You can work around it by setting LANG=C before running virt-v2v.
rm -rf '/var/tmp/ova.b0jm2D' rm -rf '/var/tmp/null.v6fmgC'
This ova is generated with tar from https://gitlab.com/dalibo/cornac/-/blob/ master/appliance/cornac.ovf and a vmdk generated by packer.
Do you have a clue on what is wrong with this .ova ?
We don't generally support imports from any OVA, only ones created by VMware, so even if the above is fixed then YMMV. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
On Fri, Apr 23, 2021 at 10:15:49AM +0100, Richard W.M. Jones wrote:
On Wed, Apr 21, 2021 at 12:14:09AM -0700, Étienne BERSAC wrote:
Hi,
I'm migrating from virt-convert to virt-v2v. I encounter the following error :
$ virt-v2v -v -x -i ova cornac.ova -o libvirt virt-v2v: virt-v2v 1.43.5 (x86_64) libvirt version: 7.0.0 [ 0.0] Opening the source -i ova cornac.ova qemu-img info json:'{ "file": { "driver": "raw", "offset": 512, "size": 512, "file": { "filename": "/tmp/v2vqemuimgtst110010.img" } } }' >/dev/null qemu-img supports "offset" and "size" in json URLs: true libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: trace: get_backend libguestfs: trace: get_backend = "direct" tar -tf 'cornac.ova' tar -xf 'cornac.ova' -C '/var/tmp/ova.b0jm2D' 'cornac.ovf' ova: testing if cornac-sda.vmdk exists in cornac.ova ova: file exists tar tRvf 'cornac.ova' libguestfs: trace: close libguestfs: closing guestfs handle 0x55c1f751e7b0 (state 0) virt-v2v: error: failed to parse line returned by tar: "bloc 0 : -rw-r--r-- bersace/bersace 3702 2020-11-12 15:16 cornac.ovf"
Interesting - I suspect this is an issue with the presumably French locale. The output of tar changes and we cannot parse it:
$ LANG=fr_FR tar tRvf /mnt/scratch/libguestfs-1.45.5.tar.gz | head -2 bloc 2 : drwxr-xr-x rjones/rjones 0 2021-04-09 11:37 libguestfs-1.45.5/ bloc 5 : -rw-rw-r-- rjones/rjones 26530 2020-03-06 19:31 libguestfs-1.45.5/COPYING.LIB
$ LANG=en_GB tar tRvf /mnt/scratch/libguestfs-1.45.5.tar.gz | head -2 block 2: drwxr-xr-x rjones/rjones 0 2021-04-09 11:37 libguestfs-1.45.5/ block 5: -rw-rw-r-- rjones/rjones 26530 2020-03-06 19:31 libguestfs-1.45.5/COPYING.LIB
This is a bug in both virt-v2v and nbdkit, but should be easy to fix.
Actually nbdkit already sets LANG=C. I pushed this fix to virt-v2v: https://github.com/libguestfs/virt-v2v/commit/ecb1b6baab60bad1536b0837fab06a... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (1)
-
Richard W.M. Jones