glance cache manage middleware not enabled

Asked by Gustavo Randich

I'm trying to configure glance image cache with folsom, but glance-cache-manage list-cached keeps saying:

       Cache management middleware not enabled on host 0.0.0.0

I've configured this in glance-api.conf

    [paste_deploy]
    flavor = keystone+cachemanagement

With Essex I had no problems with the image cache.

Requesting the cached images list to v1 of the api via curl works ok, but not with v2:

    $ curl --header "x-auth-token: $TOKEN" http://localhost:9292/v1/cached_images
    {"cached_images": []}

    $ curl --header "x-auth-token: $TOKEN" http://localhost:9292/v2/cached_images
   <html>
    <head>
     <title>404 Not Found</title>
    </head>
    <body>
     <h1>404 Not Found</h1>
     The resource could not be found.<br /><br />

Note: there's a warning about "The 'glance.client' module is deprecated in favor of the 'glanceclient' module provided by python-glanceclient" Does this affects the issue?

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Gustavo Randich
Solved:
Last query:
Last reply:
Revision history for this message
Eoghan Glynn (eglynn) said :
#1

The cachemanagement middleware is hardcoded to expose its API as v1 only.

I've raised a bug for this:

  https://bugs.launchpad.net/glance/+bug/1135537

The deprecation warning is a known issue

  https://bugs.launchpad.net/glance/+bug/1129445

and is fixed here:

  https://review.openstack.org/22305

Revision history for this message
Gustavo Randich (gustavo-randich) said :
#2

We've been using mseknibilel's Folsom Install Guide guide to install, in which a script inserts a Keystone Image endpoint with v2 instead of v1, and that was the origin of the problem (https://github.com/mseknibilel/OpenStack-Folsom-Install-guide/blob/VLAN/2NICs/Keystone_Scripts/keystone_endpoints_basic.sh)

We corrected the db record, restarted keystone, and the problem was solved.

Thank you.

Revision history for this message
Gustavo Randich (gustavo-randich) said :
#3

To enable v1 endpoint for Glance, simply replace "v2" with "v1" in the 'extra' column of the 'endpoint' table in 'keystone' database -- the row to modify is the one with "id" equal to the "service_id" with 'image' type in the 'service' table.