[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvir-list
Subject:    Re: [PATCH v4 0/4] qemu: Support rbd namespace attribute
From:       Han Han <hhan () redhat ! com>
Date:       2020-08-31 2:21:10
Message-ID: CAHjf+S-Fib=t8VmfLobQnzg+Vjxwi=uujrSEnmz5GiUNU=BY6g () mail ! gmail ! com
[Download RAW message or body]

On Tue, Aug 25, 2020 at 7:32 PM Jason Dillaman <jdillama@redhat.com> wrote:

> On Tue, Aug 25, 2020 at 2:55 AM Han Han <hhan@redhat.com> wrote:
> >
> >
> >
> > On Mon, Aug 24, 2020 at 11:09 PM Jason Dillaman <jdillama@redhat.com>
> wrote:
> >>
> >> On Mon, Aug 24, 2020 at 10:52 AM Daniel P. Berrangé <
> berrange@redhat.com> wrote:
> >> >
> >> > On Mon, Aug 24, 2020 at 10:19:59PM +0800, Han Han wrote:
> >> > > On Fri, Aug 21, 2020 at 8:01 PM Jason Dillaman <jdillama@redhat.com>
> wrote:
> >> > >
> >> > > > On Fri, Aug 7, 2020 at 5:50 AM Han Han <hhan@redhat.com> wrote:
> >> > > > >
> >> > > > > Diff from v3:
> >> > > > > - add the check for capability of rbd namespace
> >> > > > > - rename the item of rbd namespace in disk source struct
> >> > > > > - combine the commit of doc into the commit of patch
> >> > > > > - remove the code for -drive
> >> > > > >
> >> > > > > gitlab branch:
> >> > > > > https://gitlab.com/hhan2/libvirt/-/commits/rbd-namespace-v4
> >> > > > >
> >> > > > > Han Han (4):
> >> > > > >   qemu_capabilities: Add QEMU_CAPS_RBD_NAMESPACE
> >> > > > >   conf: Support to parse rbd namespace attribute
> >> > > > >   qemu: Implement rbd namespace attribute
> >> > > > >   news: qemu: Support rbd namespace
> >> > > > >
> >> > > > >  NEWS.rst                                      |  6 +++
> >> > > > >  docs/formatdomain.rst                         |  5 ++-
> >> > > > >  docs/schemas/domaincommon.rng                 |  3 ++
> >> > > > >  src/conf/domain_conf.c                        |  4 ++
> >> > > > >  src/qemu/qemu_block.c                         |  1 +
> >> > > > >  src/qemu/qemu_capabilities.c                  |  4 ++
> >> > > > >  src/qemu/qemu_capabilities.h                  |  3 ++
> >> > > > >  src/qemu/qemu_domain.c                        |  8 ++++
> >> > > > >  src/util/virstoragefile.h                     |  1 +
> >> > > > >  .../caps_5.0.0.aarch64.xml                    |  1 +
> >> > > > >  .../qemucapabilitiesdata/caps_5.0.0.ppc64.xml |  1 +
> >> > > > >  .../caps_5.0.0.riscv64.xml                    |  1 +
> >> > > > >  .../caps_5.0.0.x86_64.xml                     |  1 +
> >> > > > >  .../caps_5.1.0.x86_64.xml                     |  1 +
> >> > > > >  ...k-network-rbd-namespace.x86_64-latest.args | 41
> +++++++++++++++++++
> >> > > > >  .../disk-network-rbd-namespace.xml            | 33
> +++++++++++++++
> >> > > > >  tests/qemuxml2argvtest.c                      |  1 +
> >> > > > >  ...sk-network-rbd-namespace.x86_64-latest.xml | 41
> +++++++++++++++++++
> >> > > > >  tests/qemuxml2xmltest.c                       |  1 +
> >> > > > >  19 files changed, 156 insertions(+), 1 deletion(-)
> >> > > > >  create mode 100644
> >> > > >
> tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-latest.args
> >> > > > >  create mode 100644
> tests/qemuxml2argvdata/disk-network-rbd-namespace.xml
> >> > > > >  create mode 100644
> https://www.spinics.net/linux/fedora/libvir/msg201067.html
> >> > > >
> tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-latest.xml
> >> > > > >
> >> > > > > --
> >> > > > > 2.27.0
> >> > > > >
> >> > > >
> >> > > > Hopefully you still plan to add a "pool" attribute in a future
> series
> >> > > > to help split-up the overloaded "pool/image" name attribute.
> >> > > >
> >> > > >From my opinions, I think it's ok to keep "pool/image" in the name
> >> > > attribute if the meaning of this attribute
> >> > > is clarified in libvirt docs.
> >> > > Currently I have no plan to split the "pool/image".
> >>
> >>
> >> The problem is that having separate "<pool>/<image>" and "<pool-name>"
> >
> > <pool-name> ? I am confused here. Do you mean the pool-namespace?
>
> Yes
>
> >>
> >> attributes is semi-nonsensicle. At that point, you might as well just
> >
> > I think the only separated namespace is sensible here. Because there are
> 3 ways
> > to express the rbd image path with namespace:
>
> Except "pool-namespace" is not a standalone property, it's tied to the
> pool that you are hiding in the "name". A "pool-namespace" of "ns1" in
> pool "pool1" is not the same as the namespace "ns1" in pool "pool2".
> Like I said, you seem to be developing your own unique RBD image-spec
> format.
>
> > 1. <pool>/<namespace>/<image>
> > e.g: the rbd info comand and the qemu-img comand with legacy rbd path:
> > ➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring info
> rbd/hhan/1
> > rbd image '1':
> >         size 100 MiB in 25 objects
>
> $ rbd namespace create rbd/ns1
> $ rbd create --size 1G rbd/ns1/image1
> $ rbd info rbd/ns1/image1
> rbd image 'image1':
>     size 1 GiB in 256 objects
> ... snip ...
>
> The rbd CLI will always treat that middle section as a namespace so
> for your example it would be pool rbd, namespace hhan, and image name
> 1.
>
> >  ...
> > ➜  ~ qemu-img info
> rbd:rbd/hhan/1:conf=/home/hhan/.ceph/ceph.conf:id=admin:key=XXXXXXX
> > image: json:{"driver": "raw", "file": {"pool": "rbd", "image": "1",
> "conf": "/home/hhan/.ceph/ceph.conf", "driver": "rbd", "user": "admin"}}
> > file format: raw
> > ...
> > Note that the missing namespace attribute in image json is caused by
> https://bugzilla.redhat.com/show_bug.cgi?id=1821528
> >
> > 2. only separated namespace: <pool>/><image> and namespace attribute or
> option
> > e.g: the rbd command with namespace option
> > ➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring info
> rbd/1 --namespace hhan
> > rbd image '1':
> >         size 100 MiB in 25 objects
> >         order 22 (4 MiB objects)
> > ...
> >
> > 3. separated pool, namespace, image
> > e.g: qemu blockdev options of rbd:
> https://github.com/qemu/qemu/blob/30aa19446d82358a30eac3b556b4d6641e00b7c1/qapi/block-core.json#L3585
> > ➜  ~ qemu-img info 'json:{"driver": "raw", "file": {"pool": "rbd",
> "image": "1", "conf": "/home/hhan/.ceph/ceph.conf", "driver": "rbd",
> "user": "admin", "namespace":"hhan"}}'
> > image: json:{"driver": "raw", "file": {"pool": "rbd", "image": "1",
> "conf": "/home/hhan/.ceph/ceph.conf", "driver": "rbd", "user": "admin"}}
> > file format: raw
> > ...
> >
> >
> > From these precedents, I think it is no problem to use the 2nd pattern
> in libvirt XML.
> > I reject the 1st pattern because of compat issues.
> > Suppose the 1st pattern is used, it will cause problems in the following
> case.
> > Since rbd allows the image name contains '/'
>
> That's not true, RBD has not permitted "/" in pool nor image names for
> years -- and it's definitely not allowed when creating images in
> namespaces:
>
> $ rbd create --size 1G rbd/ns1/image1/
> rbd: invalid spec 'rbd/ns1/image1/'
> $ rbd create --size 1G --pool rbd --namespace ns1 --image "image1/"
> rbd: invalid spec 'image1/'
>
I am not sure how I created the image 'hhan/2'  in the default namespace.
It cannot be created by
rbd command now. However it seems buggy on
qemu-img(librbd1-12.2.7-9.el8.x86_64
qemu-img-5.1.0-3.module+el8.3.0+7708+740a1315.x86_64):
➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring
namespace ls
NAME
hhan
test
➜  ~ qemu-img create
 'rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ=='
1M
Formatting
'rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==',
fmt=raw size=1048576
➜  ~ qemu-img create
 'rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ=='
1M
Formatting
'rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==',
fmt=raw size=1048576
qemu-img:
rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==:
error rbd create: File exists
➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring
namespace ls
NAME
hhan
test
➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring -p rbd
ls|grep new1
➜  ~ qemu-img info
rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==
image: json:{"driver": "raw", "file": {"pool": "rbd", "image": "new1",
"conf": "/root/.ceph/ceph.conf", "driver": "rbd", "user": "admin"}}
file format: raw
virtual size: 1 MiB (1048576 bytes)
disk size: unavailable
cluster_size: 4194304

Well, the image "rbd/aa/new1" could be found by qemu-img but cannot be
listed by rbd. Very confusing here.

Since the '/' in image name is invalid, the format of name attribute
"<pool>/[pool-ns]<image>" is more sensible.
I will adapt that in the next patch series.


> Is this a bug in "qemu-img" that allowed you to create "hhan/2" below?
> Does it allow you to create that image in a namespace or does your
> example no longer work? QEMU should also parse that middle section as
> the namespace [1].
>
> > ➜  ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring -p
> rbd ls
> > attach-new
> > copy
> > hhan/2
> >
> > If I used 'hhan/2' image in libvirt XML at the previous libvirt and then
> I updated libvirt to the version support 1st pattern,
> > the new libvirt parse the name='rbd/hhan/2' as pool 'rbd', namespace
> 'hhan', image '2',instead of the pool 'rbd', image
> > 'hhan/2', default namespace.
> >
> >
> > For the 3rd pattern, separating all the attributes, the xml will look
> like
> > <source protocol="rbd" pool="POOL" image="IMG" namespace="NS">
> >
> > However it cannot replace the old attribute name='<pool>/<image>'
> because of the compatibility.
> > What about keeping the old attribute the adapting this new pattern?
> > Well, it looks weird only rbd protocol adapts this new pattern because
> all the network protocols in libvirt
> > use the old xml pattern <source protocol="PROTO" name="XX"> (seeing the
> examples in
> https://libvirt.org/formatdomain.html#hard-drives-floppy-disks-cdroms)
> > How about adapting this new pattern to all the network protocols?
> > Considering the effort and the benifits of that, I think it is not
> worthwhile.
> >
> >> drop the "pool_namespace" attribute" and parse the image name just
> >> like the rest of Ceph/RBD code does as
> >> "[<pool-name>/[<pool_namespace>/]]<image-name>". Why should libvirt
> >> invent its own custom way to describe the image location?
> >>
> >> See this thread here [1] from back in April where you said you would
> >> split it out.
> >>
> > Yes.
> > The above is why I changed my mind and decided to use the only separated
> attribute namespace.
> >>
> >> > That would create back compat issues too, so I can't see us splitting
> >> > that.
> >>
> >> Yes, I understand the backwards compatibility concerns so you would
> >> need to continue to support "<pool>/<image>", but you could at least
> >> force the new format if a "<pool-namespace>" was specified.
> >>
> >>
> >>
> >> > Regards,
> >> > Daniel
> >> > --
> >> > |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> >> > |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> >> > |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
> >> >
> >>
> >> [1] https://www.spinics.net/linux/fedora/libvir/msg201067.html
> >>
> >> --
> >> Jason
> >>
> >
> >
> > --
> > Best regards,
> > -----------------------------------
> > Han Han
> > Senior Quality Engineer
> > Redhat.
> >
> > Email: hhan@redhat.com
> > Phone: +861065339333
>
> [1] https://github.com/qemu/qemu/blob/master/block/rbd.c#L150
>
> --
> Jason
>
>

-- 
Best regards,
-----------------------------------
Han Han
Senior Quality Engineer
Redhat.

Email: hhan@redhat.com
Phone: +861065339333

[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Tue, Aug 25, 2020 at 7:32 PM Jason Dillaman &lt;<a \
href="mailto:jdillama@redhat.com">jdillama@redhat.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Aug 25, 2020 \
at 2:55 AM Han Han &lt;<a href="mailto:hhan@redhat.com" \
target="_blank">hhan@redhat.com</a>&gt; wrote:<br> &gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Aug 24, 2020 at 11:09 PM Jason Dillaman &lt;<a \
href="mailto:jdillama@redhat.com" target="_blank">jdillama@redhat.com</a>&gt; \
wrote:<br> &gt;&gt;<br>
&gt;&gt; On Mon, Aug 24, 2020 at 10:52 AM Daniel P. Berrangé &lt;<a \
href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>&gt; \
wrote:<br> &gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, Aug 24, 2020 at 10:19:59PM +0800, Han Han wrote:<br>
&gt;&gt; &gt; &gt; On Fri, Aug 21, 2020 at 8:01 PM Jason Dillaman &lt;<a \
href="mailto:jdillama@redhat.com" target="_blank">jdillama@redhat.com</a>&gt; \
wrote:<br> &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; On Fri, Aug 7, 2020 at 5:50 AM Han Han &lt;<a \
href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a>&gt; wrote:<br> \
&gt;&gt; &gt; &gt; &gt; &gt;<br> &gt;&gt; &gt; &gt; &gt; &gt; Diff from v3:<br>
&gt;&gt; &gt; &gt; &gt; &gt; - add the check for capability of rbd namespace<br>
&gt;&gt; &gt; &gt; &gt; &gt; - rename the item of rbd namespace in disk source \
struct<br> &gt;&gt; &gt; &gt; &gt; &gt; - combine the commit of doc into the commit \
of patch<br> &gt;&gt; &gt; &gt; &gt; &gt; - remove the code for -drive<br>
&gt;&gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; &gt; gitlab branch:<br>
&gt;&gt; &gt; &gt; &gt; &gt; <a \
href="https://gitlab.com/hhan2/libvirt/-/commits/rbd-namespace-v4" rel="noreferrer" \
target="_blank">https://gitlab.com/hhan2/libvirt/-/commits/rbd-namespace-v4</a><br> \
&gt;&gt; &gt; &gt; &gt; &gt;<br> &gt;&gt; &gt; &gt; &gt; &gt; Han Han (4):<br>
&gt;&gt; &gt; &gt; &gt; &gt;     qemu_capabilities: Add QEMU_CAPS_RBD_NAMESPACE<br>
&gt;&gt; &gt; &gt; &gt; &gt;     conf: Support to parse rbd namespace attribute<br>
&gt;&gt; &gt; &gt; &gt; &gt;     qemu: Implement rbd namespace attribute<br>
&gt;&gt; &gt; &gt; &gt; &gt;     news: qemu: Support rbd namespace<br>
&gt;&gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; &gt;   NEWS.rst                                               \
|   6 +++<br> &gt;&gt; &gt; &gt; &gt; &gt;   docs/formatdomain.rst                    \
|   5 ++-<br> &gt;&gt; &gt; &gt; &gt; &gt;   docs/schemas/domaincommon.rng            \
|   3 ++<br> &gt;&gt; &gt; &gt; &gt; &gt;   src/conf/domain_conf.c                    \
|   4 ++<br> &gt;&gt; &gt; &gt; &gt; &gt;   src/qemu/qemu_block.c                     \
|   1 +<br> &gt;&gt; &gt; &gt; &gt; &gt;   src/qemu/qemu_capabilities.c               \
|   4 ++<br> &gt;&gt; &gt; &gt; &gt; &gt;   src/qemu/qemu_capabilities.h              \
|   3 ++<br> &gt;&gt; &gt; &gt; &gt; &gt;   src/qemu/qemu_domain.c                    \
|   8 ++++<br> &gt;&gt; &gt; &gt; &gt; &gt;   src/util/virstoragefile.h               \
|   1 +<br> &gt;&gt; &gt; &gt; &gt; &gt;   .../caps_5.0.0.aarch64.xml                 \
|   1 +<br> &gt;&gt; &gt; &gt; &gt; &gt;   \
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml |   1 +<br> &gt;&gt; &gt; &gt; &gt; \
&gt;   .../caps_5.0.0.riscv64.xml                              |   1 +<br> &gt;&gt; \
&gt; &gt; &gt; &gt;   .../caps_5.0.0.x86_64.xml                                |   1 \
+<br> &gt;&gt; &gt; &gt; &gt; &gt;   .../caps_5.1.0.x86_64.xml                        \
|   1 +<br> &gt;&gt; &gt; &gt; &gt; &gt;   \
...k-network-rbd-namespace.x86_64-latest.args | 41 +++++++++++++++++++<br> &gt;&gt; \
&gt; &gt; &gt; &gt;   .../disk-network-rbd-namespace.xml                  | 33 \
+++++++++++++++<br> &gt;&gt; &gt; &gt; &gt; &gt;   tests/qemuxml2argvtest.c           \
|   1 +<br> &gt;&gt; &gt; &gt; &gt; &gt;   \
...sk-network-rbd-namespace.x86_64-latest.xml | 41 +++++++++++++++++++<br> &gt;&gt; \
&gt; &gt; &gt; &gt;   tests/qemuxml2xmltest.c                                   |   1 \
+<br> &gt;&gt; &gt; &gt; &gt; &gt;   19 files changed, 156 insertions(+), 1 \
deletion(-)<br> &gt;&gt; &gt; &gt; &gt; &gt;   create mode 100644<br>
&gt;&gt; &gt; &gt; &gt; \
tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-latest.args<br> &gt;&gt; \
&gt; &gt; &gt; &gt;   create mode 100644 \
tests/qemuxml2argvdata/disk-network-rbd-namespace.xml<br> &gt;&gt; &gt; &gt; &gt; \
&gt;   create mode 100644<a \
href="https://www.spinics.net/linux/fedora/libvir/msg201067.html" rel="noreferrer" \
target="_blank">https://www.spinics.net/linux/fedora/libvir/msg201067.html</a><br> \
&gt;&gt; &gt; &gt; &gt; \
tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-latest.xml<br> &gt;&gt; \
&gt; &gt; &gt; &gt;<br> &gt;&gt; &gt; &gt; &gt; &gt; --<br>
&gt;&gt; &gt; &gt; &gt; &gt; 2.27.0<br>
&gt;&gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; Hopefully you still plan to add a &quot;pool&quot; attribute \
in a future series<br> &gt;&gt; &gt; &gt; &gt; to help split-up the overloaded \
&quot;pool/image&quot; name attribute.<br> &gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt;From my opinions, I think it&#39;s ok to keep \
&quot;pool/image&quot; in the name<br> &gt;&gt; &gt; &gt; attribute if the meaning of \
this attribute<br> &gt;&gt; &gt; &gt; is clarified in libvirt docs.<br>
&gt;&gt; &gt; &gt; Currently I have no plan to split the &quot;pool/image&quot;.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; The problem is that having separate &quot;&lt;pool&gt;/&lt;image&gt;&quot; \
and &quot;&lt;pool-name&gt;&quot;<br> &gt;<br>
&gt; &lt;pool-name&gt; ? I am confused here. Do you mean the pool-namespace?<br>
<br>
Yes<br>
<br>
&gt;&gt;<br>
&gt;&gt; attributes is semi-nonsensicle. At that point, you might as well just<br>
&gt;<br>
&gt; I think the only separated namespace is sensible here. Because there are 3 \
ways<br> &gt; to express the rbd image path with namespace:<br>
<br>
Except &quot;pool-namespace&quot; is not a standalone property, it&#39;s tied to \
the<br> pool that you are hiding in the &quot;name&quot;. A \
&quot;pool-namespace&quot; of &quot;ns1&quot; in<br> pool &quot;pool1&quot; is not \
the same as the namespace &quot;ns1&quot; in pool &quot;pool2&quot;.<br> Like I said, \
you seem to be developing your own unique RBD image-spec<br> format.<br>
<br>
&gt; 1. &lt;pool&gt;/&lt;namespace&gt;/&lt;image&gt;<br>
&gt; e.g: the rbd info comand and the qemu-img comand with legacy rbd path:<br>
&gt; ➜   ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring info \
rbd/hhan/1<br> &gt; rbd image &#39;1&#39;:<br>
&gt;              size 100 MiB in 25 objects<br>
<br>
$ rbd namespace create rbd/ns1<br>
$ rbd create --size 1G rbd/ns1/image1<br>
$ rbd info rbd/ns1/image1<br>
rbd image &#39;image1&#39;:<br>
      size 1 GiB in 256 objects<br>
... snip ...<br>
<br>
The rbd CLI will always treat that middle section as a namespace so<br>
for your example it would be pool rbd, namespace hhan, and image name<br>
1.<br>
<br>
&gt;   ...<br>
&gt; ➜   ~ qemu-img info \
rbd:rbd/hhan/1:conf=/home/hhan/.ceph/ceph.conf:id=admin:key=XXXXXXX<br> &gt; image: \
json:{&quot;driver&quot;: &quot;raw&quot;, &quot;file&quot;: {&quot;pool&quot;: \
&quot;rbd&quot;, &quot;image&quot;: &quot;1&quot;, &quot;conf&quot;: \
&quot;/home/hhan/.ceph/ceph.conf&quot;, &quot;driver&quot;: &quot;rbd&quot;, \
&quot;user&quot;: &quot;admin&quot;}}<br> &gt; file format: raw<br>
&gt; ...<br>
&gt; Note that the missing namespace attribute in image json is caused by <a \
href="https://bugzilla.redhat.com/show_bug.cgi?id=1821528" rel="noreferrer" \
target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1821528</a><br> &gt;<br>
&gt; 2. only separated namespace: &lt;pool&gt;/&gt;&lt;image&gt; and namespace \
attribute or option<br> &gt; e.g: the rbd command with namespace option<br>
&gt; ➜   ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring info rbd/1 \
--namespace hhan<br> &gt; rbd image &#39;1&#39;:<br>
&gt;              size 100 MiB in 25 objects<br>
&gt;              order 22 (4 MiB objects)<br>
&gt; ...<br>
&gt;<br>
&gt; 3. separated pool, namespace, image<br>
&gt; e.g: qemu blockdev options of rbd: <a \
href="https://github.com/qemu/qemu/blob/30aa19446d82358a30eac3b556b4d6641e00b7c1/qapi/block-core.json#L3585" \
rel="noreferrer" target="_blank">https://github.com/qemu/qemu/blob/30aa19446d82358a30eac3b556b4d6641e00b7c1/qapi/block-core.json#L3585</a><br>
 &gt; ➜   ~ qemu-img info &#39;json:{&quot;driver&quot;: &quot;raw&quot;, \
&quot;file&quot;: {&quot;pool&quot;: &quot;rbd&quot;, &quot;image&quot;: \
&quot;1&quot;, &quot;conf&quot;: &quot;/home/hhan/.ceph/ceph.conf&quot;, \
&quot;driver&quot;: &quot;rbd&quot;, &quot;user&quot;: &quot;admin&quot;, \
&quot;namespace&quot;:&quot;hhan&quot;}}&#39;<br> &gt; image: \
json:{&quot;driver&quot;: &quot;raw&quot;, &quot;file&quot;: {&quot;pool&quot;: \
&quot;rbd&quot;, &quot;image&quot;: &quot;1&quot;, &quot;conf&quot;: \
&quot;/home/hhan/.ceph/ceph.conf&quot;, &quot;driver&quot;: &quot;rbd&quot;, \
&quot;user&quot;: &quot;admin&quot;}}<br> &gt; file format: raw<br>
&gt; ...<br>
&gt;<br>
&gt;<br>
&gt; From these precedents, I think it is no problem to use the 2nd pattern in \
libvirt XML.<br> &gt; I reject the 1st pattern because of compat issues.<br>
&gt; Suppose the 1st pattern is used, it will cause problems in the following \
case.<br> &gt; Since rbd allows the image name contains &#39;/&#39;<br>
<br>
That&#39;s not true, RBD has not permitted &quot;/&quot; in pool nor image names \
for<br> years -- and it&#39;s definitely not allowed when creating images in<br>
namespaces:<br>
<br>
$ rbd create --size 1G rbd/ns1/image1/<br>
rbd: invalid spec &#39;rbd/ns1/image1/&#39;<br>
$ rbd create --size 1G --pool rbd --namespace ns1 --image &quot;image1/&quot;<br>
rbd: invalid spec &#39;image1/&#39;<br></blockquote><div>I am not sure how I created \
the image &#39;hhan/2&#39;   in the default namespace. It cannot be created \
by</div><div>rbd command now. However it seems buggy on \
qemu-img(librbd1-12.2.7-9.el8.x86_64 \
qemu-img-5.1.0-3.module+el8.3.0+7708+740a1315.x86_64):</div><div>➜   ~ rbd -c \
~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring namespace ls                   \
<br>NAME <br>hhan <br>test</div><div>➜   ~ qemu-img create   \
&#39;rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==&#39; \
1M<br>Formatting &#39;rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==&#39;, \
fmt=raw size=1048576<br>➜   ~ qemu-img create   \
&#39;rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==&#39; \
1M<br>Formatting &#39;rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==&#39;, \
fmt=raw size=1048576<br>qemu-img: \
rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==: \
error rbd create: File exists</div><div>➜   ~ rbd -c ~/.ceph/ceph.conf -k \
~/.ceph/ceph.client.admin.keyring namespace ls<br>NAME <br>hhan <br>test \
<br></div><div>➜   ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring \
-p rbd ls|grep new1</div><div>➜   ~ qemu-img info \
rbd:rbd/aa/new1:conf=/root/.ceph/ceph.conf:id=admin:key=AQBm9fldc9zhMhAAeDDedFhu55XjV1YhdqDOkQ==<br>image: \
json:{&quot;driver&quot;: &quot;raw&quot;, &quot;file&quot;: {&quot;pool&quot;: \
&quot;rbd&quot;, &quot;image&quot;: &quot;new1&quot;, &quot;conf&quot;: \
&quot;/root/.ceph/ceph.conf&quot;, &quot;driver&quot;: &quot;rbd&quot;, \
&quot;user&quot;: &quot;admin&quot;}}<br>file format: raw<br>virtual size: 1 MiB \
(1048576 bytes)<br>disk size: unavailable<br>cluster_size: \
4194304</div><div><br></div><div>Well, the image &quot;rbd/aa/new1&quot; could be \
found by qemu-img but cannot be listed by rbd. Very confusing here. \
<br></div><div><br></div><div>Since the &#39;/&#39; in image name is invalid, the \
format of name attribute &quot;&lt;pool&gt;/[pool-ns]&lt;image&gt;&quot; is more \
sensible.</div><div>I will adapt that in the next patch \
series.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px \
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
Is this a bug in &quot;qemu-img&quot; that allowed you to create &quot;hhan/2&quot; \
below?<br> Does it allow you to create that image in a namespace or does your<br>
example no longer work? QEMU should also parse that middle section as<br>
the namespace [1].<br>
<br>
&gt; ➜   ~ rbd -c ~/.ceph/ceph.conf -k ~/.ceph/ceph.client.admin.keyring -p rbd \
ls<br> &gt; attach-new<br>
&gt; copy<br>
&gt; hhan/2<br>
&gt;<br>
&gt; If I used &#39;hhan/2&#39; image in libvirt XML at the previous libvirt and then \
I updated libvirt to the version support 1st pattern,<br> &gt; the new libvirt parse \
the name=&#39;rbd/hhan/2&#39; as pool &#39;rbd&#39;, namespace &#39;hhan&#39;, image \
&#39;2&#39;,instead of the pool &#39;rbd&#39;, image<br> &gt; &#39;hhan/2&#39;, \
default namespace.<br> &gt;<br>
&gt;<br>
&gt; For the 3rd pattern, separating all the attributes, the xml will look like<br>
&gt; &lt;source protocol=&quot;rbd&quot; pool=&quot;POOL&quot; image=&quot;IMG&quot; \
namespace=&quot;NS&quot;&gt;<br> &gt;<br>
&gt; However it cannot replace the old attribute \
name=&#39;&lt;pool&gt;/&lt;image&gt;&#39; because of the compatibility.<br> &gt; What \
about keeping the old attribute the adapting this new pattern?<br> &gt; Well, it \
looks weird only rbd protocol adapts this new pattern because all the network \
protocols in libvirt<br> &gt; use the old xml pattern &lt;source \
protocol=&quot;PROTO&quot; name=&quot;XX&quot;&gt; (seeing the examples in <a \
href="https://libvirt.org/formatdomain.html#hard-drives-floppy-disks-cdroms" \
rel="noreferrer" target="_blank">https://libvirt.org/formatdomain.html#hard-drives-floppy-disks-cdroms</a>)<br>
 &gt; How about adapting this new pattern to all the network protocols?<br>
&gt; Considering the effort and the benifits of that, I think it is not \
worthwhile.<br> &gt;<br>
&gt;&gt; drop the &quot;pool_namespace&quot; attribute&quot; and parse the image name \
just<br> &gt;&gt; like the rest of Ceph/RBD code does as<br>
&gt;&gt; &quot;[&lt;pool-name&gt;/[&lt;pool_namespace&gt;/]]&lt;image-name&gt;&quot;. \
Why should libvirt<br> &gt;&gt; invent its own custom way to describe the image \
location?<br> &gt;&gt;<br>
&gt;&gt; See this thread here [1] from back in April where you said you would<br>
&gt;&gt; split it out.<br>
&gt;&gt;<br>
&gt; Yes.<br>
&gt; The above is why I changed my mind and decided to use the only separated \
attribute namespace.<br> &gt;&gt;<br>
&gt;&gt; &gt; That would create back compat issues too, so I can&#39;t see us \
splitting<br> &gt;&gt; &gt; that.<br>
&gt;&gt;<br>
&gt;&gt; Yes, I understand the backwards compatibility concerns so you would<br>
&gt;&gt; need to continue to support &quot;&lt;pool&gt;/&lt;image&gt;&quot;, but you \
could at least<br> &gt;&gt; force the new format if a \
&quot;&lt;pool-namespace&gt;&quot; was specified.<br> &gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt; Daniel<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; |: <a href="https://berrange.com" rel="noreferrer" \
target="_blank">https://berrange.com</a>         -o-      <a \
href="https://www.flickr.com/photos/dberrange" rel="noreferrer" \
target="_blank">https://www.flickr.com/photos/dberrange</a> :|<br> &gt;&gt; &gt; |: \
<a href="https://libvirt.org" rel="noreferrer" \
target="_blank">https://libvirt.org</a>              -o-                  <a \
href="https://fstop138.berrange.com" rel="noreferrer" \
target="_blank">https://fstop138.berrange.com</a> :|<br> &gt;&gt; &gt; |: <a \
href="https://entangle-photo.org" rel="noreferrer" \
target="_blank">https://entangle-photo.org</a>      -o-      <a \
href="https://www.instagram.com/dberrange" rel="noreferrer" \
target="_blank">https://www.instagram.com/dberrange</a> :|<br> &gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; [1] <a href="https://www.spinics.net/linux/fedora/libvir/msg201067.html" \
rel="noreferrer" target="_blank">https://www.spinics.net/linux/fedora/libvir/msg201067.html</a><br>
 &gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Jason<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Best regards,<br>
&gt; -----------------------------------<br>
&gt; Han Han<br>
&gt; Senior Quality Engineer<br>
&gt; Redhat.<br>
&gt;<br>
&gt; Email: <a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a><br>
&gt; Phone: +861065339333<br>
<br>
[1] <a href="https://github.com/qemu/qemu/blob/master/block/rbd.c#L150" \
rel="noreferrer" target="_blank">https://github.com/qemu/qemu/blob/master/block/rbd.c#L150</a><br>
 <br>
-- <br>
Jason<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" \
class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Best \
regards,</div><div dir="ltr">-----------------------------------<br></div><div \
dir="ltr">Han Han<br>Senior Quality Engineer<br>Redhat.<br><br>Email: <a \
href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a><br>Phone: \
+861065339333<br></div></div></div></div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic