enable_v2_api = True is not working

Bug #1566379 reported by Swami Reddy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned

Bug Description

I have set the "eanble_v2_api=True" in the glance-api.conf and restarted the glance-api service.

After the above, expected that glance will use the V2 apis. But still it uses V1 APIs.

The above has been observed with glance version 0.14.1

Tags: glance
Swami Reddy (swamireddy)
description: updated
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

If you set:

 enable_v2_api=True

the glance v2 api will be available for use.

If you set enable_v2_api=False

the glance v2 api will not be available.

You can see which versions are enabled by querying the end point.
For example here both v1 and v2 are enabled:

 $ curl http://localhost:9292 | python -mjson.tool

{
    "versions": [
        {
            "id": "v2.3",
            "links": [
                {
                    "href": "http://localhost:9292/v2/",
                    "rel": "self"
                }
            ],
            "status": "CURRENT"
        },
        {
            "id": "v2.2",
            "links": [
                {
                    "href": "http://localhost:9292/v2/",
                    "rel": "self"
                }
            ],
            "status": "SUPPORTED"
        },
        {
            "id": "v2.1",
            "links": [
                {
                    "href": "http://localhost:9292/v2/",
                    "rel": "self"
                }
            ],
            "status": "SUPPORTED"
        },
        {
            "id": "v2.0",
            "links": [
                {
                    "href": "http://localhost:9292/v2/",
                    "rel": "self"
                }
            ],
            "status": "SUPPORTED"
        },
        {
            "id": "v1.1",
            "links": [
                {
                    "href": "http://localhost:9292/v1/",
                    "rel": "self"
                }
            ],
            "status": "SUPPORTED"
        },
        {
            "id": "v1.0",
            "links": [
                {
                    "href": "http://localhost:9292/v1/",
                    "rel": "self"
                }
            ],
            "status": "SUPPORTED"
        }
    ]
}

Can you give more detail of

* what command you are running
* what output you expect to be generated
* what output is actually being generated

Thanks

Revision history for this message
Ian Cordasco (icordasc) wrote :

You appear to be using glanceclient 0.14.2. That version of the client defaults to using v1 of the API. You can manually override it or upgrade to a new version that uses the v2 API by default.

Changed in glance:
status: New → Invalid
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

(To manually override add --os-image-api-version 2, eg : glance --os-image-api-version 2 image-list)

Revision history for this message
Swami Reddy (swamireddy) wrote :

I ahve set "enable_v2_api = True and restarted the glance-api service:
== here is the json output:
curl https://localhost:9292 | python -mjson.tool

{

    "versions": [

        {

            "id": "v2.2",

            "links": [

                {

                    "href": "http://localhost:9292/v2/",

                    "rel": "self"

                }

            ],

            "status": "CURRENT"

        },

        {

            "id": "v2.1",

            "links": [

                {

                    "href": "http://localhost:9292/v2/",

                    "rel": "self"

                }

            ],

            "status": "SUPPORTED"

        },

        {

            "id": "v2.0",

            "links": [

                {

                    "href": "http://localhost:9292/v2/",

                    "rel": "self"

                }

            ],

            "status": "SUPPORTED"

        },

        {

            "id": "v1.1",

            "links": [

                {

                    "href": "http://localhost:9292/v1/",

                    "rel": "self"

                }

            ],

            "status": "CURRENT"

        },

        {

            "id": "v1.0",

            "links": [

                {

                    "href": "http://localhost:9292/v1/",

                    "rel": "self"

                }

            ],

            "status": "SUPPORTED"

        }

    ]

}
==

I ran "glance image-list"
Still use the https://localhost:9292/v1/images/... used (not https://localhost:9292/v2/images/....

Revision history for this message
Swami Reddy (swamireddy) wrote :

Here is the environment variable setting works i.e after setting --os-image-api-version 2, glance uses V2 APIs. But in my use case I can NOT use the environment variable.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.