<div dir="ltr"><div><div><div><div>Hello Rich,<br><br></div>Interesting.  Thanks for the explanation.<br><br></div>When you specify an rbd on the command line for virt-sysprep, do you expect the path to include the monitor address?<br>
<br></div>e.g.:<br></div>>> virt-sysprep -a rbd://host-name/pool-name/device-name<br><div><div><div><br>If I understand correctly, libvirt is able to understand the ceph configuration, so when I create a device with qemu-img I only specify the protocol and pool/device.<br>
<br>e.g.:<br>>> qemu-img create rbd:pool-name/device-name 5G<br><br></div><div>(there is some voodoo that I don't understand, I've got a whole thread on trying to get qemu-img to create format 2 rbds by default... but that's for another thread)<br>
<br></div><div>Would it be possible to specify rbds like this instead?  Or is the scope bigger than I'm understanding and that would cause issues with other disk types specified for the --add parameter.  It seems like --add can take either a URI or a physical disk path.<br>
<br></div><div>Thanks for all your help helping me to understand.<br><br></div><div>Best Regards,<br></div><div>Jon A<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 6, 2013 at 2:37 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Nov 06, 2013 at 02:25:54PM -0700, Jon wrote:<br>
> Hello Richard,<br>
><br>
> Haha, ok, here's a good one: I commented that if statement out at line 300,<br>
> applied your patch (I see you updated the github of this code, perhaps<br>
> that's the best place to grab the code from), and when I run virt-sysprep,<br>
> I get the following parameter for my disk drive:<br>
><br>
> >> qemu-system-x86_64: -drive<br>
> file=rbd:ibvirt-pool/server-clone-test:mon_host=192.168.0.40\:6789\;192.168.0.35\:6789\;192.168.0.2\:6789:auth_supported=none,cache=writeback,id=hd0,if=none:<br>
> error opening pool ibvirt-pool<br>
><br>
> Since "ibvirt-pool" doesn't exist. :)<br>
><br>
> So this says to me that the function "create_drive_non_file" is consuming<br>
> that first slash somewhere.<br>
<br>
</div>Unfortunately this code is rather intricate (and intricately broken),<br>
but the problem is likely to be here:<br>
<br>
 src/drives.c:<br>
    /* Skip the mandatory leading '/' character on exportname. */<br>
    return safe_asprintf (g, "rbd:%s:mon_host=%s%s%s%s",<br>
                          &src->u.exportname[1],<br>
                          mon_host,<br>
                          username ? username : "",<br>
                          auth,<br>
                          secret ? secret : "");<br>
<br>
The problem that this code is trying (and failing) to deal with is<br>
that when you use the URL on the guestfish command line, the URL is<br>
something like "rbd://<a href="http://example.com/foo/bar" target="_blank">example.com/foo/bar</a>" and the path part of this<br>
has to start with a "/" character.  There is simply no way to specify<br>
a URL without this.<br>
<br>
However this assumption should *not* have made its way into the<br>
libguestfs library, since other paths into this code, such as from<br>
libvirt XML, have no such restrictions.<br>
<br>
So it's currently somewhat broken.<br>
<div class="im"><br>
Rich.<br>
<br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" target="_blank">http://people.redhat.com/~rjones</a><br>
</div>Read my programming blog: <a href="http://rwmj.wordpress.com" target="_blank">http://rwmj.wordpress.com</a><br>
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)<br>
</blockquote></div><br></div></div>