<div><div dir="auto">Hi Massimo,</div></div><div dir="auto">Cool, thank you for confirmation, I will try to reproduce this in my environment. It will take some time, will revert back to you once done. Meanwhile could you please try the same with single store (disabling the multiple stores)?</div><div dir="auto"><br></div><div dir="auto">Thank you,</div><div dir="auto"><br></div><div dir="auto">Abhishek </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 27 Aug 2019 at 6:33 PM, Massimo Sgaravatto <<a href="mailto:massimo.sgaravatto@gmail.com">massimo.sgaravatto@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Abhishek</div><div><br></div><div>Yes, before trying the:</div><div><br></div><div>glance location-add --url rbd://8162f291-00b6-4b40-a8b4-1981a8c09b64/images-prod/6bcc4eab-ed35-42dc-88bd-1d45de73b628/snap 6bcc4eab-ed35-42dc-88bd-1d45de73b628<br></div><div><br></div><div>command, I uploaded the image to ceph. And indeed I can see it:</div><div><br></div><div><br></div><div><br></div><div dir="ltr">[root@ceph-mon-01 ~]# rbd info images-prod/6bcc4eab-ed35-42dc-88bd-1d45de73b628<br>rbd image '6bcc4eab-ed35-42dc-88bd-1d45de73b628':<br> size 10GiB in 1280 objects<br> order 23 (8MiB objects)<br> block_name_prefix: rbd_data.b7b56aa1e4f0bc<br> format: 2<br> features: layering<br> flags: <br> create_timestamp: Tue Aug 27 11:42:32 2019</div><div dir="ltr"><br>[root@ceph-mon-01 ~]# rbd snap ls images-prod/6bcc4eab-ed35-42dc-88bd-1d45de73b628<br>SNAPID NAME SIZE TIMESTAMP <br>455500 snap 10GiB Tue Aug 27 11:46:37 2019 <br>[root@ceph-mon-01 ~]# <br></div><div><br></div><div><br></div><div>Cheers, Massimo</div></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 27, 2019 at 2:41 PM Abhishek Kekane <<a href="mailto:akekane@redhat.com" target="_blank">akekane@redhat.com</a>> 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"><div><div dir="auto">Hi Massimo,</div></div><div dir="auto"><br></div><div dir="auto">I need to reproduce this first, but pretty much sure this issue is not because you configured multiple backends. What you are doing is downloading existing image to your local storage and then uploading it to glance using add-location operation.</div><div dir="auto"><br></div><div dir="auto">So before adding this using add-location operation have you manually uploaded this image to ceph/rbd? if not then how you are building your location url which you are mentioning in the add-location command? If this location is not existing then it might be a problem.</div><div dir="auto"><br></div><div dir="auto">Thank you,</div><div dir="auto"><br></div><div dir="auto">Abhishek</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 27 Aug 2019 at 5:09 PM, Massimo Sgaravatto <<a href="mailto:massimo.sgaravatto@gmail.com" target="_blank">massimo.sgaravatto@gmail.com</a>> 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"><div dir="ltr">I have a Rocky installation where glance is configured with multiple backends. This [*] is the relevant part of the glance configuration.<div><br></div><div>I now need to dismiss the file backend and move the images-snapshots stored there to rbd.</div><div><br></div><div><br></div><div>I had in mind to follow this procedure (already successfully tested with an older version of OpenStack):</div><div><br></div><div>1) download the image from the file backend (glance image-download --file <file> <imageid></div><div>2) upload the file <file> to rbd, relying on this function: <a href="https://github.com/openstack/glance_store/blob/stable/rocky/glance_store/_drivers/rbd.py#L445" target="_blank">https://github.com/openstack/glance_store/blob/stable/rocky/glance_store/_drivers/rbd.py#L445</a></div><div>3) glance location-add --url rbd://xyz <imageid></div><div>4) glance location-delete --url file://abc <imageid></div><div><br></div><div>I have problems with 3:</div><div><br></div><div># glance --debug location-add --url rbd://8162f291-00b6-4b40-a8b4-1981a8c09b64/images-prod/6bcc4eab-ed35-42dc-88bd-1d45de73b628/snap 6bcc4eab-ed35-42dc-88bd-1d45de73b628<br></div><div>...</div><div>...</div><div>DEBUG:keystoneauth.session:PATCH call to image for <a href="https://cloud-areapd.pd.infn.it:9292/v2/images/6bcc4eab-ed35-42dc-88bd-1d45de73b628" target="_blank">https://cloud-areapd.pd.infn.it:9292/v2/images/6bcc4eab-ed35-42dc-88bd-1d45de73b628</a> used request id req-6c0598cc-582c-4ce7-a14c-5d1bb6ec4f14<br>Request returned failure status 400.<br>DEBUG:glanceclient.common.http:Request returned failure status 400.<br>Traceback (most recent call last):<br> File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 687, in main<br> OpenStackImagesShell().main(argv)<br> File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 591, in main<br> args.func(client, args)<br> File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 749, in do_location_add<br> image = gc.images.add_location(<a href="http://args.id" target="_blank">args.id</a>, args.url, metadata)<br> File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 448, in add_location<br> response = self._send_image_update_request(image_id, add_patch)<br> File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 598, in inner<br> return RequestIdProxy(wrapped(*args, **kwargs))<br> File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 432, in _send_image_update_request<br> data=json.dumps(patch_body))<br> File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 340, in patch<br> return self.request(url, 'PATCH', **kwargs)<br> File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 377, in request<br> return self._handle_response(resp)<br> File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 126, in _handle_response<br> raise exc.from_response(resp, resp.content)<br>HTTPBadRequest: 400 Bad Request: Invalid location (HTTP 400)<br>400 Bad Request: Invalid location (HTTP 400)<br></div><div><br></div><div><br></div><div>As far as I can see with the "openstack" client there is not something to add/delete a location. </div><div>So I guess it is necessary to change the 'direct_url' and 'locations' properties.</div><div><br></div><div>If I try to change the direct_url property:</div><div><br></div><div># openstack image set --property direct_url='rbd://8162f291-00b6-4b40-a8b4-1981a8c09b64/images-prod/6bcc4eab-ed35-42dc-88bd-1d45de73b628/snap' 6bcc4eab-ed35-42dc-88bd-1d45de73b628<br>403 Forbidden: Attribute 'direct_url' is read-only. (HTTP 403)<br></div><div><br></div><div>Any hints ?</div><div>Thanks, Massimo</div><div><br></div><div>[*]<br><div><br></div><div>[default]</div><div>...</div><div>enabled_backends = file:file,http:http,rbd:rbd<br>show_image_direct_url = true<br>show_multiple_locations = true<br></div><div><br></div><div>[glance_store]<br>default_backend = rbd<br></div><div><br></div><div>[file]<br>filesystem_store_datadir = /var/lib/glance/images/<br><br><br>[rbd]<br>rbd_store_chunk_size = 8<br>rbd_store_ceph_conf = /etc/ceph/ceph.conf<br>rbd_store_user = glance-prod<br>rbd_store_pool = images-prod<br></div><div><br></div></div></div>
</blockquote></div></div>-- <br><div dir="ltr" class="m_-1923753681616412501m_7935332065770787526gmail-m_-2147403014962011692gmail_signature"><div dir="ltr"><div>Thanks & Best Regards,<br><br></div>Abhishek Kekane<br></div></div>
</blockquote></div></div>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Thanks & Best Regards,<br><br></div>Abhishek Kekane<br></div></div>