Bug 1369715

Summary: openstack client using v1 api instead of v2
Product: Red Hat OpenStack Reporter: VIKRANT <vaggarwa>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED WONTFIX QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0 (Liberty)CC: egafford, eharney, scohen, srevivo
Target Milestone: ---   
Target Release: 10.0 (Newton)   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-12 15:40:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description VIKRANT 2016-08-24 08:32:16 UTC
Description of problem:

openstack client using v1 api instead of v2

# openstack volume list 

In the api.log file, I can see that it's using v1 API, but it should use v2 API.

~~~
2016-08-24 16:24:44.137 27862 INFO eventlet.wsgi.server [req-e6ccd5d1-2388-434c-ba2f-ba8c9ad184a2 ebb10c603735423f9b45b6bd9882212c 1d78f174a138424da07bf6f7b3fead49 - - -] 192.168.122.51 - - [24/Aug/2016 16:24:44] "GET /v1/1d78f174a138424da07bf6f7b3fead49/volumes/detail HTTP/1.1" 200 4502 0.330317
~~~

As per the help page, default version of api is v2 but it's taking v1.

~~~
  --os-volume-api-version <volume-api-version>
                        Volume API version, default=2 (Env:
                        OS_VOLUME_API_VERSION)
~~~

We can workaround this issue by exporting "export OS_VOLUME_API_VERSION=2" 

~~~
2016-08-24 16:31:07.320 27866 INFO cinder.api.openstack.wsgi [req-634d6d60-162b-49be-86e8-e155cbad8eb7 ebb10c603735423f9b45b6bd9882212c 1d78f174a138424da07bf6f7b3fead49 - - -] GET http://192.168.122.51:8776/v2/1d78f174a138424da07bf6f7b3fead49/volumes/detail
~~~

Version-Release number of selected component (if applicable):
RHEL OSP 8 

How reproducible:
Everytime

Steps to Reproduce:
1.
2.
3.

Actual results:
It's using v1 API by default

Expected results:
It should use v2 API as per help page. 


Additional info:

Comment 2 Eric Harney 2016-09-09 19:22:11 UTC
Cinder v2 API does not offer much over v1 for existing deployments.  Bug 1351271 is tracking using v3 by default in OSP10, which should handle this going forward.