<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">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">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">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>