On Sat, Sep 16, 2023 at 03:56:07PM +0000, Teja Konapalli wrote:> Hi Richard & Team, > > > > Could you please help here on the below failure of mounting disk using > libguestfs. > > > > OS version: RHEL 8.2 > > Libguestfs version: 1.38.0 stable > > > > > > Error logs: > > > > libguestfs: trace: add_drive_ro "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > libguestfs: trace: add_drive "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > "readonly:true" > libguestfs: creating COW overlay to protect original drive content > libguestfs: trace: disk_create "/tmp/libguestfsCpl8My/overlay3.qcow2" "qcow2" > -1 "backingfile:/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > libguestfs: command: run: qemu-img > libguestfs: command: run: \ create > libguestfs: command: run: \ -f qcow2 > libguestfs: command: run: \ -o backing_file=/var/opt/tmp/GRE//RAJA/ > RAJAT-flat.vmdk > libguestfs: command: run: \ /tmp/libguestfsCpl8My/overlay3.qcow2 > Formatting '/tmp/libguestfsCpl8My/overlay3.qcow2', fmt=qcow2 size=21474836480 > backing_file=/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk cluster_size=65536 > lazy_refcounts=off refcount_bits=16 > libguestfs: trace: disk_create = -1 (error)^^ There should be an error message between this two lines. Without seeing what the error is, it's hard to know what the problem is. Is this happening in a program you wrote? If so you probably want to read the bit about how to handle error messages: https://libguestfs.org/guestfs.3.html#error-handling Rich.> libguestfs: trace: add_drive = -1 (error) > libguestfs: trace: add_drive_ro = -1 (error) > libguestfs: trace: close > libguestfs: closing guestfs handle 0x1e89340 (state 0) > libguestfs: command: run: rm > libguestfs: command: run: \ -rf /tmp/libguestfsCpl8My >-- 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
Teja Konapalli
2023-Sep-16 16:42 UTC
[Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
@Raja Ram Sharma Can you please help here with the details requested by Rich. To answer this question Is this happening in a program you wrote? Yes, we had written our code to use libguestfs API in c++. We can have a short call and discuss with you or team, could you please help with the timings next week Monday or Tuesday. Thanks Teja Konapalli -----Original Message----- From: Richard W.M. Jones <rjones at redhat.com> Sent: Saturday, September 16, 2023 9:39 PM To: Teja Konapalli <tkonapalli at opentext.com> Cc: libguestfs at redhat.com; Raja Ram Sharma <rsharma6 at opentext.com>; Divyanshu Kumar <dkumar3 at opentext.com> Subject: [EXTERNAL] - Re: LIBGUESTFS mount disk failure CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you feel that the email is suspicious, please report it using PhishAlarm. On Sat, Sep 16, 2023 at 03:56:07PM +0000, Teja Konapalli wrote:> Hi Richard & Team, > > > > Could you please help here on the below failure of mounting disk using > libguestfs. > > > > OS version: RHEL 8.2 > > Libguestfs version: 1.38.0 stable > > > > > > Error logs: > > > > libguestfs: trace: add_drive_ro "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > libguestfs: trace: add_drive "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > "readonly:true" > libguestfs: creating COW overlay to protect original drive content > libguestfs: trace: disk_create "/tmp/libguestfsCpl8My/overlay3.qcow2" "qcow2" > -1 "backingfile:/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > libguestfs: command: run: qemu-img > libguestfs: command: run: \ create > libguestfs: command: run: \ -f qcow2 > libguestfs: command: run: \ -o backing_file=/var/opt/tmp/GRE//RAJA/ > RAJAT-flat.vmdk > libguestfs: command: run: \ /tmp/libguestfsCpl8My/overlay3.qcow2 > Formatting '/tmp/libguestfsCpl8My/overlay3.qcow2', fmt=qcow2 > size=21474836480 backing_file=/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk > cluster_size=65536 lazy_refcounts=off refcount_bits=16 > libguestfs: trace: disk_create = -1 (error)^^ There should be an error message between this two lines. Without seeing what the error is, it's hard to know what the problem is. Is this happening in a program you wrote? If so you probably want to read the bit about how to handle error messages: https://urldefense.com/v3/__https://libguestfs.org/guestfs.3.html*error-handling__;Iw!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiF0T-D7hw$ Rich.> libguestfs: trace: add_drive = -1 (error) > libguestfs: trace: add_drive_ro = -1 (error) > libguestfs: trace: close > libguestfs: closing guestfs handle 0x1e89340 (state 0) > libguestfs: command: run: rm > libguestfs: command: run: \ -rf /tmp/libguestfsCpl8My >-- Richard Jones, Virtualization Group, Red Hat https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiH8yx7oyA$ Read my programming and virtualization blog: https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiEeYKbusQ$ virt-builder quickly builds VMs from scratch https://urldefense.com/v3/__http://libguestfs.org/virt-builder.1.html__;!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiGXgRfjPQ$
Raja Ram Sharma
2023-Sep-16 16:54 UTC
[Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
Hi Richard, Thank you for the reply, I hope this mail finds you well. We resolved guestfs_add_drive failure, now guestfs_add_drive is adding disk successfully after adding "format:raw". But guestfs_launch is failing Kindly help me to troubleshoot or to find any workaround. Error_callback is in-place, it return guestfs_last_error() guestfs_last_error(): [ 2023-09-16 17:24:20 ] errno: ( 10 ) : command: waitpid: No child processes [ 2023-09-16 17:24:20 ] errno: ( 10 ) : command: waitpid: No child processes While: guestfs_lanch error: libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: trace: set_backend "direct" libguestfs: trace: set_backend = 0 libguestfs: create: flags = 0, handle = 0xbb0a70, program = greagent.exe libguestfs: trace: add_drive "/var/opt/omni/tmp/GRE/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/2023/09/16-3/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/Datastore2-9166/RAJATEST/RAJATEST_1-flat.vmdk" "format:raw" libguestfs: trace: add_drive = 0 libguestfs: trace: add_drive "/var/opt/omni/tmp/GRE/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/2023/09/16-3/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/Datastore2-9166/RAJATEST/RAJATEST_2-flat.vmdk" "format:raw" libguestfs: trace: add_drive = 0 libguestfs: trace: add_drive "/var/opt/omni/tmp/GRE/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/2023/09/16-3/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/Datastore2-9166/RAJATEST/RAJATEST-flat.vmdk" "format:raw" libguestfs: trace: add_drive = 0 libguestfs: trace: launch libguestfs: trace: max_disks libguestfs: trace: max_disks = 255 libguestfs: trace: get_tmpdir libguestfs: trace: get_tmpdir = "/tmp" libguestfs: trace: version libguestfs: trace: version = <struct guestfs_version = major: 1, minor: 38, release: 4, extra: rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt, > libguestfs: trace: get_backend libguestfs: trace: get_backend = "direct" libguestfs: launch: program=greagent.exe libguestfs: launch: version=1.38.4rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt libguestfs: launch: backend registered: unix libguestfs: launch: backend registered: uml libguestfs: launch: backend registered: libvirt libguestfs: launch: backend registered: direct libguestfs: launch: backend=direct libguestfs: launch: tmpdir=/tmp/libguestfsMzD9Rl libguestfs: launch: umask=0002 libguestfs: launch: euid=0 libguestfs: is_openable: /dev/kvm: No such file or directory libguestfs: trace: get_backend_setting "force_tcg" libguestfs: trace: get_backend_setting = NULL (error) libguestfs: trace: get_cachedir libguestfs: trace: get_cachedir = "/var/tmp" libguestfs: begin building supermin appliance libguestfs: run supermin libguestfs: command: run: /usr/bin/supermin libguestfs: command: run: \ --build libguestfs: command: run: \ --verbose libguestfs: command: run: \ --if-newer libguestfs: command: run: \ --lock /var/tmp/.guestfs-0/lock libguestfs: command: run: \ --copy-kernel libguestfs: command: run: \ -f ext2 libguestfs: command: run: \ --host-cpu x86_64 libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d libguestfs: command: run: \ -o /var/tmp/.guestfs-0/appliance.d supermin: version: 5.1.19 supermin: rpm: detected RPM version 4.14 supermin: package handler: fedora/rpm supermin: acquiring lock on /var/tmp/.guestfs-0/lock supermin: if-newer: output does not need rebuilding libguestfs: trace: launch = -1 (error) libguestfs: trace: close libguestfs: closing guestfs handle 0xbb0a70 (state 0) libguestfs: command: run: rm libguestfs: command: run: \ -rf /tmp/libguestfsMzD9Rl Thanks RR -----Original Message----- From: Richard W.M. Jones <rjones at redhat.com> Sent: Saturday, September 16, 2023 9:39 PM To: Teja Konapalli <tkonapalli at opentext.com> Cc: libguestfs at redhat.com; Raja Ram Sharma <rsharma6 at opentext.com>; Divyanshu Kumar <dkumar3 at opentext.com> Subject: [EXTERNAL] - Re: LIBGUESTFS mount disk failure CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you feel that the email is suspicious, please report it using PhishAlarm. On Sat, Sep 16, 2023 at 03:56:07PM +0000, Teja Konapalli wrote:> Hi Richard & Team, > > > > Could you please help here on the below failure of mounting disk using > libguestfs. > > > > OS version: RHEL 8.2 > > Libguestfs version: 1.38.0 stable > > > > > > Error logs: > > > > libguestfs: trace: add_drive_ro "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > libguestfs: trace: add_drive "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > "readonly:true" > libguestfs: creating COW overlay to protect original drive content > libguestfs: trace: disk_create "/tmp/libguestfsCpl8My/overlay3.qcow2" "qcow2" > -1 "backingfile:/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk" > libguestfs: command: run: qemu-img > libguestfs: command: run: \ create > libguestfs: command: run: \ -f qcow2 > libguestfs: command: run: \ -o backing_file=/var/opt/tmp/GRE//RAJA/ > RAJAT-flat.vmdk > libguestfs: command: run: \ /tmp/libguestfsCpl8My/overlay3.qcow2 > Formatting '/tmp/libguestfsCpl8My/overlay3.qcow2', fmt=qcow2 > size=21474836480 backing_file=/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk > cluster_size=65536 lazy_refcounts=off refcount_bits=16 > libguestfs: trace: disk_create = -1 (error)^^ There should be an error message between this two lines. Without seeing what the error is, it's hard to know what the problem is. Is this happening in a program you wrote? If so you probably want to read the bit about how to handle error messages: https://urldefense.com/v3/__https://libguestfs.org/guestfs.3.html*error-handling__;Iw!!Obbck6kTJA!cv1KjwDluVdY6QeDtrOh_Pwp78cbFyf3tGQ_N76zq1LTl8f3ml4l1FUbxYL0DYvKOC8zw0dsAbychXT0$ Rich.> libguestfs: trace: add_drive = -1 (error) > libguestfs: trace: add_drive_ro = -1 (error) > libguestfs: trace: close > libguestfs: closing guestfs handle 0x1e89340 (state 0) > libguestfs: command: run: rm > libguestfs: command: run: \ -rf /tmp/libguestfsCpl8My >-- Richard Jones, Virtualization Group, Red Hat https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!cv1KjwDluVdY6QeDtrOh_Pwp78cbFyf3tGQ_N76zq1LTl8f3ml4l1FUbxYL0DYvKOC8zw0dsAUbGivne$ Read my programming and virtualization blog: https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!cv1KjwDluVdY6QeDtrOh_Pwp78cbFyf3tGQ_N76zq1LTl8f3ml4l1FUbxYL0DYvKOC8zw0dsAaDLxRcq$ virt-builder quickly builds VMs from scratch https://urldefense.com/v3/__http://libguestfs.org/virt-builder.1.html__;!!Obbck6kTJA!cv1KjwDluVdY6QeDtrOh_Pwp78cbFyf3tGQ_N76zq1LTl8f3ml4l1FUbxYL0DYvKOC8zw0dsAWV9JWbZ$
Richard W.M. Jones
2023-Sep-16 18:30 UTC
[Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
Hi, can you run: libguestfs-test-tool and send us the complete output. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard W.M. Jones
2023-Sep-16 20:36 UTC
[Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
Thanks for providing the libguestfs-test-tool output in a previous message.> While: guestfs_lanch error: > libguestfs: trace: set_verbose true > libguestfs: trace: set_verbose = 0 > libguestfs: trace: set_backend "direct" > libguestfs: trace: set_backend = 0Here you're setting backend = "direct", and while that isn't necessarily a problem in itself, the libguestfs-test-tool output that you provided was for the (normal, for RHEL) libvirt backend. This could make a difference, so what's the output of: $ LIBGUESTFS_BACKEND=direct libguestfs-test-tool ? By the way, unless you have a specific reason to set 'LIBGUESTFS_BACKEND=direct' that you can articulate, it is best not to set this as it is less secure and less well tested. If you just copied that environment variable from somewhere without understanding why, then don't do that. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW