guestfish Remote Images IPv6 Support
I have scoured the web and can't find anything on the topic: Is IPv6 supported for remote image targets? For example: guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901 Does not work citing the following: libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: create: flags = 0, handle = 0x5560231bdfb0, program = guestfish libguestfs: trace: set_pgroup true libguestfs: trace: set_pgroup = 0 libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789" libguestfs: creating COW overlay to protect original drive content libguestfs: trace: get_tmpdir libguestfs: trace: get_tmpdir = "/tmp" libguestfs: trace: disk_create "/tmp/libguestfs3pGMi6/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: qemu-img libguestfs: command: run: \ create libguestfs: command: run: \ -f qcow2 libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option :cefc:1]:6789:auth_supported: No such file or directory Could not open backing image to determine size. libguestfs: error: qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: qemu-img exited with error status 1, see debug messages above libguestfs: trace: disk_create = -1 (error) libguestfs: trace: add_drive = -1 (error) libguestfs: trace: close libguestfs: closing guestfs handle 0x5560231bdfb0 (state 0) libguestfs: command: run: rm libguestfs: command: run: \ -rf /tmp/libguestfs3pGMi6 Other variations of the IPv6 address fail in a similar fashion, some even failing with the URI parser. It seems as though everything after the first : in the address is getting parsed as args. Changing this IPv6 address over to a hostname allows the command to work. Unfortunately I'm working within the confines of OpenStack and some of it's requests here and my Ceph cluster is v6-only so I can't easily just have it use hostnames to solve the issue. -- Jonathan Wright KnownHost, LLC https://www.knownhost.com
On Fri, Mar 29, 2019 at 06:17:17PM -0500, Jonathan Wright wrote:
I have scoured the web and can't find anything on the topic: Is IPv6 supported for remote image targets?
It definitely should work, although I don't know if anyone has tried using the address explicitly (rather than a hostname which resolves to an AAAA record).
For example:
guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901
Does not work citing the following:
The important lines are these. Firstly guestfish parses the URL into an actual libguestfs API call, which looks fine to me:
libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789"
This is probably where it goes wrong:
"/tmp/libguestfs3pGMi6/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" "backingformat:raw"
libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option :cefc:1]:6789:auth_supported: No such file or directory Could not open backing image to determine size.
The code in libguestfs is supposed to turn the guestfs_add_drive ‘servers’ parameter into a Ceph URL for qemu: https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84... and I suppose this is being done wrong somehow (I don't have a Ceph server to test). At a guess I would say that it seems as if ':' characters must be quoted somehow (backslash?) because they are also used to separate the address and port number. 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
Unfortunately I do need to use the address explicitly as opposed to hostnames because the source of the data fed here is Ceph's monmap which returns the addresses explicitly. I've tried all the common ways to escape the : in the v6 address to no avail. I definitely agree that the problem looks to be it parsing the colons as if the port comes next and then everything after that is args. Should I file a bug report? There doesn't seem to be any way to prevent the : from getting parsed incorrectly. On 3/30/19 2:50 AM, Richard W.M. Jones wrote:
On Fri, Mar 29, 2019 at 06:17:17PM -0500, Jonathan Wright wrote:
I have scoured the web and can't find anything on the topic: Is IPv6 supported for remote image targets? It definitely should work, although I don't know if anyone has tried using the address explicitly (rather than a hostname which resolves to an AAAA record).
For example:
guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901
Does not work citing the following: The important lines are these. Firstly guestfish parses the URL into an actual libguestfs API call, which looks fine to me:
libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789" This is probably where it goes wrong:
"/tmp/libguestfs3pGMi6/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option :cefc:1]:6789:auth_supported: No such file or directory Could not open backing image to determine size. The code in libguestfs is supposed to turn the guestfs_add_drive ‘servers’ parameter into a Ceph URL for qemu:
https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84...
and I suppose this is being done wrong somehow (I don't have a Ceph server to test).
At a guess I would say that it seems as if ':' characters must be quoted somehow (backslash?) because they are also used to separate the address and port number.
Rich.
-- Jonathan Wright KnownHost, LLC https://www.knownhost.com
On Mon, Apr 01, 2019 at 08:45:48AM -0500, Jonathan Wright wrote:
Unfortunately I do need to use the address explicitly as opposed to hostnames because the source of the data fed here is Ceph's monmap which returns the addresses explicitly.
I've tried all the common ways to escape the : in the v6 address to no avail. I definitely agree that the problem looks to be it parsing the colons as if the port comes next and then everything after that is args.
Should I file a bug report? There doesn't seem to be any way to prevent the : from getting parsed incorrectly.
Is it a bug in qemu? Anyway yes if it's a bug please file a bug report about it. Rich.
On 3/30/19 2:50 AM, Richard W.M. Jones wrote:
On Fri, Mar 29, 2019 at 06:17:17PM -0500, Jonathan Wright wrote:
I have scoured the web and can't find anything on the topic: Is IPv6 supported for remote image targets? It definitely should work, although I don't know if anyone has tried using the address explicitly (rather than a hostname which resolves to an AAAA record).
For example:
guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901
Does not work citing the following: The important lines are these. Firstly guestfish parses the URL into an actual libguestfs API call, which looks fine to me:
libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789" This is probably where it goes wrong:
"/tmp/libguestfs3pGMi6/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option :cefc:1]:6789:auth_supported: No such file or directory Could not open backing image to determine size. The code in libguestfs is supposed to turn the guestfs_add_drive ‘servers’ parameter into a Ceph URL for qemu:
https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84...
and I suppose this is being done wrong somehow (I don't have a Ceph server to test).
At a guess I would say that it seems as if ':' characters must be quoted somehow (backslash?) because they are also used to separate the address and port number.
Rich.
-- Jonathan Wright KnownHost, LLC https://www.knownhost.com
-- 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
I believe the bug lies in libguestfs. Taking out the commands being sent to QEMU and using qemu-img info I can recreate the error: # qemu-img info "rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" qemu-img: Could not open 'rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none': invalid conf option :cefc:1]:6789:auth_supported: No such file or directory When escaping the : in the v6 address (just like is done with the port's : ) the command works as expected. # qemu-img info "rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none" image: json:{"driver": "raw", "file": {"pool": "images", "image": "CentOS-7-x86_64-GenericCloud-1901", "driver": "rbd", "=keyvalue-pairs": "[\"mon_host\", \"[fd00::cefc:1]:6789\", \"auth_supported\", \"none\"]"}} file format: raw virtual size: 8.0G (8589934592 bytes) disk size: unavailable cluster_size: 4194304 Snapshot list: ID TAG VM SIZE DATE VM CLOCK snap snap 8.0G 1969-12-31 18:00:00 00:00:00.000 I don't really know much about C but I'm going to try to hack together a basic fix in the code to escape the colons in v6 addresses and if I can get it clean enough I'll submit a PR otherwise a bug report. On 4/1/19 9:30 AM, Richard W.M. Jones wrote:
On Mon, Apr 01, 2019 at 08:45:48AM -0500, Jonathan Wright wrote:
Unfortunately I do need to use the address explicitly as opposed to hostnames because the source of the data fed here is Ceph's monmap which returns the addresses explicitly.
I've tried all the common ways to escape the : in the v6 address to no avail. I definitely agree that the problem looks to be it parsing the colons as if the port comes next and then everything after that is args.
Should I file a bug report? There doesn't seem to be any way to prevent the : from getting parsed incorrectly. Is it a bug in qemu? Anyway yes if it's a bug please file a bug report about it.
Rich.
On 3/30/19 2:50 AM, Richard W.M. Jones wrote:
On Fri, Mar 29, 2019 at 06:17:17PM -0500, Jonathan Wright wrote:
I have scoured the web and can't find anything on the topic: Is IPv6 supported for remote image targets? It definitely should work, although I don't know if anyone has tried using the address explicitly (rather than a hostname which resolves to an AAAA record).
For example:
guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901
Does not work citing the following: The important lines are these. Firstly guestfish parses the URL into an actual libguestfs API call, which looks fine to me:
libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789" This is probably where it goes wrong:
"/tmp/libguestfs3pGMi6/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option :cefc:1]:6789:auth_supported: No such file or directory Could not open backing image to determine size. The code in libguestfs is supposed to turn the guestfs_add_drive ‘servers’ parameter into a Ceph URL for qemu:
https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84...
and I suppose this is being done wrong somehow (I don't have a Ceph server to test).
At a guess I would say that it seems as if ':' characters must be quoted somehow (backslash?) because they are also used to separate the address and port number.
Rich.
-- Jonathan Wright KnownHost, LLC https://www.knownhost.com
-- Jonathan Wright KnownHost, LLC https://www.knownhost.com
On Mon, Apr 01, 2019 at 09:45:56AM -0500, Jonathan Wright wrote:
I believe the bug lies in libguestfs.
Taking out the commands being sent to QEMU and using qemu-img info I can recreate the error:
# qemu-img info "rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" qemu-img: Could not open 'rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none': invalid conf option :cefc:1]:6789:auth_supported: No such file or directory
When escaping the : in the v6 address (just like is done with the port's : ) the command works as expected.
Ah I see. Can you try the small patch attached? 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
This worked wonderfully! What are the odds of getting this upstream in the near future? I'd rather not build from source in production. # ./run guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901 libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: trace: set_tmpdir "/root/libguestfs/tmp" libguestfs: trace: set_tmpdir = 0 libguestfs: trace: set_cachedir "/root/libguestfs/tmp" libguestfs: trace: set_cachedir = 0 libguestfs: trace: set_path "/root/libguestfs/appliance" libguestfs: trace: set_path = 0 libguestfs: create: flags = 0, handle = 0xf4afb0, program = guestfish libguestfs: trace: set_pgroup true libguestfs: trace: set_pgroup = 0 libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789" libguestfs: creating COW overlay to protect original drive content libguestfs: trace: get_tmpdir libguestfs: trace: get_tmpdir = "/root/libguestfs/tmp" libguestfs: trace: disk_create "/root/libguestfs/tmp/libguestfs9gclsg/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: qemu-img libguestfs: command: run: \ create libguestfs: command: run: \ -f qcow2 libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /root/libguestfs/tmp/libguestfs9gclsg/overlay1.qcow2 Formatting '/root/libguestfs/tmp/libguestfs9gclsg/overlay1.qcow2', fmt=qcow2 size=8589934592 backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none backing_fmt=raw cluster_size=65536 lazy_refcounts=off refcount_bits=16 libguestfs: trace: disk_create = 0 libguestfs: trace: add_drive = 0 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: ‘help’ for help on commands ‘man’ to read the manual ‘quit’ to quit the shell
<fs> quit
libguestfs: trace: shutdown libguestfs: trace: shutdown = 0 libguestfs: trace: close libguestfs: closing guestfs handle 0xf4afb0 (state 0) libguestfs: command: run: rm libguestfs: command: run: \ -rf /root/libguestfs/tmp/libguestfs9gclsg On 4/1/19 10:45 AM, Richard W.M. Jones wrote:
On Mon, Apr 01, 2019 at 09:45:56AM -0500, Jonathan Wright wrote:
I believe the bug lies in libguestfs.
Taking out the commands being sent to QEMU and using qemu-img info I can recreate the error:
# qemu-img info "rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" qemu-img: Could not open 'rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none': invalid conf option :cefc:1]:6789:auth_supported: No such file or directory
When escaping the : in the v6 address (just like is done with the port's : ) the command works as expected. Ah I see. Can you try the small patch attached?
Rich.
-- Jonathan Wright KnownHost, LLC https://www.knownhost.com
On Mon, Apr 01, 2019 at 11:23:28AM -0500, Jonathan Wright wrote:
This worked wonderfully! What are the odds of getting this upstream in the near future? I'd rather not build from source in production.
Thanks for testing, I'll push it upstream now and backport it to 1.40 in the near future. Rich.
# ./run guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901 libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: trace: set_tmpdir "/root/libguestfs/tmp" libguestfs: trace: set_tmpdir = 0 libguestfs: trace: set_cachedir "/root/libguestfs/tmp" libguestfs: trace: set_cachedir = 0 libguestfs: trace: set_path "/root/libguestfs/appliance" libguestfs: trace: set_path = 0 libguestfs: create: flags = 0, handle = 0xf4afb0, program = guestfish libguestfs: trace: set_pgroup true libguestfs: trace: set_pgroup = 0 libguestfs: trace: add_drive "images/CentOS-7-x86_64-GenericCloud-1901" "readonly:true" "format:raw" "protocol:rbd" "server:tcp:[fd00::cefc:1]:6789" libguestfs: creating COW overlay to protect original drive content libguestfs: trace: get_tmpdir libguestfs: trace: get_tmpdir = "/root/libguestfs/tmp" libguestfs: trace: disk_create "/root/libguestfs/tmp/libguestfs9gclsg/overlay1.qcow2" "qcow2" -1 "backingfile:rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none" "backingformat:raw" libguestfs: command: run: qemu-img libguestfs: command: run: \ create libguestfs: command: run: \ -f qcow2 libguestfs: command: run: \ -o backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none,backing_fmt=raw libguestfs: command: run: \ /root/libguestfs/tmp/libguestfs9gclsg/overlay1.qcow2 Formatting '/root/libguestfs/tmp/libguestfs9gclsg/overlay1.qcow2', fmt=qcow2 size=8589934592 backing_file=rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00\:\:cefc\:1]\:6789:auth_supported=none backing_fmt=raw cluster_size=65536 lazy_refcounts=off refcount_bits=16 libguestfs: trace: disk_create = 0 libguestfs: trace: add_drive = 0
Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images.
Type: ‘help’ for help on commands ‘man’ to read the manual ‘quit’ to quit the shell
<fs> quit
libguestfs: trace: shutdown libguestfs: trace: shutdown = 0 libguestfs: trace: close libguestfs: closing guestfs handle 0xf4afb0 (state 0) libguestfs: command: run: rm libguestfs: command: run: \ -rf /root/libguestfs/tmp/libguestfs9gclsg
On 4/1/19 10:45 AM, Richard W.M. Jones wrote:
On Mon, Apr 01, 2019 at 09:45:56AM -0500, Jonathan Wright wrote:
I believe the bug lies in libguestfs.
Taking out the commands being sent to QEMU and using qemu-img info I can recreate the error:
# qemu-img info "rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none" qemu-img: Could not open 'rbd:images/CentOS-7-x86_64-GenericCloud-1901:mon_host=[fd00::cefc:1]\:6789:auth_supported=none': invalid conf option :cefc:1]:6789:auth_supported: No such file or directory
When escaping the : in the v6 address (just like is done with the port's : ) the command works as expected. Ah I see. Can you try the small patch attached?
Rich.
-- Jonathan Wright KnownHost, LLC https://www.knownhost.com
-- 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 (2)
-
Jonathan Wright -
Richard W.M. Jones