On Tue, Oct 14, 2014 at 02:43:31PM +0000, VONDRA Alain wrote:> Rich, > The conversion did'nt finish, and I don't have any core dump. > The qemu-img seems to hang, but doesn't crash...Please connect gdb to the hung process and get a stack trace to find out where it's hanging. 'strace -p ...' output might also be enlightening, if it is not hung but doing "something" (albeit not making progress). I should also note that if qemu-img convert hits a lot of zeroes in the source (possible, because fstrim wasnt successful), then it will consume CPU skipping them, but won't write anything for a while. 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
Rich, I've followed your instructions to trace, but I am not very skilful with gdb, maybe I made a mistake : (1) As root do: echo core.%p > /proc/sys/kernel/core_pattern -> OK (2) Before running virt-v2v, do: ulimited -c unlimited -> I think it's ulimit -c unlimited -> -> OK and you should get a core.* file in the current directory when qemu-img segfaults. Attach that file to gdb to get a stack trace: gdb /usr/bin/qemu-img core.XYZ -> Do I need to wait the crash becase I don't have any core ??? (gdb) t a a bt Thanks Alain Alain VONDRA Chargé d'exploitation des Systèmes d'Information Direction Administrative et Financière +33 1 44 39 77 76 UNICEF France 3 rue Duguay Trouin 75006 PARIS www.unicef.fr -----Message d'origine----- De : Richard W.M. Jones [mailto:rjones@redhat.com] Envoyé : mardi 14 octobre 2014 16:52 À : VONDRA Alain Cc : libguestfs@redhat.com Objet : Re: [Libguestfs] Virt-v2v conversion issue On Tue, Oct 14, 2014 at 02:43:31PM +0000, VONDRA Alain wrote:> Rich, > The conversion did'nt finish, and I don't have any core dump. > The qemu-img seems to hang, but doesn't crash...Please connect gdb to the hung process and get a stack trace to find out where it's hanging. 'strace -p ...' output might also be enlightening, if it is not hung but doing "something" (albeit not making progress). I should also note that if qemu-img convert hits a lot of zeroes in the source (possible, because fstrim wasnt successful), then it will consume CPU skipping them, but won't write anything for a while. 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
On Tue, Oct 14, 2014 at 03:40:22PM +0000, VONDRA Alain wrote:> Rich, > I've followed your instructions to trace, but I am not very skilful with gdb, maybe I made a mistake : > > (1) As root do: > > echo core.%p > /proc/sys/kernel/core_pattern -> OK > > (2) Before running virt-v2v, do: > > ulimited -c unlimited -> I think it's ulimit -c unlimited -> -> OK > > and you should get a core.* file in the current directory when qemu-img segfaults. Attach that file to gdb to get a stack trace: > > gdb /usr/bin/qemu-img core.XYZ -> Do I need to wait the crash becase I don't have any core ???Yes, you have to wait for qemu-img to crash before there will be a core dump. If it's not crashing, then connect to qemu-img directly, something like this: gdb /usr/bin/qemu-img `pidof qemu-img` and run this command:> (gdb) t a a btto show the stack trace in all threads. If qemu-img is consuming CPU then it's probably not hung. I'm still interested to find out why fstrim didn't work. Can you run: guestfish --ro -d unc-srv-qual03><fs> run ><fs> part-list /dev/sda ><fs> part-list /dev/sdb ><fs> part-list /dev/sdc ><fs> part-list /dev/sdd(etc) I'd be interested to see if the partitions are unaligned, which is the only reason why fstrim should fail on NTFS. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html