[openstack-dev] [glance] Does glance_store swift driver support range requests ?

Matt Keenan matt.keenan at oracle.com
Mon Nov 13 11:47:37 UTC 2017


Hi,

  Just configured devstack on Fedora 26, and by default glance_store 
uses swift for image storage. When attempting to get a specific range 
from a glance stored image, it's reporting range requests are not 
supported e.g.:

     $ curl -i -X GET -r 0-32 -H "X-Auth-Token: $auth_token" 
http://10.169.104.255/image/v2/images/29b7aa
     5e-3ec2-49b5-ab6b-d6cc5099f46c/file
     HTTP/1.1 400 Bad Request
     Date: Mon, 13 Nov 2017 10:43:23 GMT
     Server: Apache/2.4.27 (Fedora) OpenSSL/1.1.0f-fips mod_wsgi/4.5.15 
Python/2.7
     Content-Length: 205
     Content-Type: text/html; charset=UTF-8
     x-openstack-request-id: req-5ed2239f-165b-406f-969b-5cc4ab8c632d
     Connection: close

     <html>
      <head>
       <title>400 Bad Request</title>
      </head>
      <body>
       <h1>400 Bad Request</h1>
       Getting images randomly from this store is not supported. Offset: 
0, length: 33<br /><br />
      </body>

Upon investigation, glance-api log is emitting:

     Nov 13 10:45:31 devstack at g-api.service[22783]: #033[01;31mERROR 
glance.location [#033[01;36mNone 
req-ad6da3f0-ead1-486a-a873-d301f02b0888 #033[00;36mdemo 
demo#033[01;31m] #033[01;35m#033[0│·····················1;31mGlance 
tried all active locations to get data for image 
29b7aa5e-3ec2-49b5-ab6b-d6cc5099f46c but all have failed.#033[00m: 
StoreRandomGetNotSupported: Getting images randomly from this store is 
notMDg4OCAjMDMzWzAwOzM2bW supported. Offset: 0, length: 33

The exception StoreRandomGetNotSupported is emitted by glance_store from 
glance_store/capabilities.py:

     op_exec_map = {
         'get': (exceptions.StoreRandomGetNotSupported
                 if kwargs.get('offset') or kwargs.get('chunk_size') else
                 exceptions.StoreGetNotSupported),
         'add': exceptions.StoreAddDisabled,
         'delete': exceptions.StoreDeleteNotSupported}

Looking at _driver/swift/store.py I think range requests are supported, 
it I've be unsuccessful in configuring it.

Does the glance_store swift driver support range requests ?

Can it be configured within a conf file, by somehow adding a capability ?

thanks

Matt

-- 




More information about the OpenStack-dev mailing list