Ask Your Question
0

Question about using api v3 by default in openstack commands

asked 2020-08-06 09:28:18 -0600

tekkafedora gravatar image

Hello, I have a Queens release where I have V3 Identity API with eg domain and group functionalities and commands. I notice that

1) Both if I have no OS_AUTH_* variables explicitly set in my bash environment and if I have: OS_AUTH_URL=..../v2 and OS_IDENTITY_API_VERSION=2

when I run "openstack command --help" (eg "openstack user create --help) the V3 functionalities are automatically excluded by the options, so that in my example above I don't see that for the "user create " command there is a "--domain" option

Instead if I source my rc file with: OS_AUTH_URL=..../v3 and OS_IDENTITY_API_VERSION=3

I get the --help output with the "--domain" and "--group" options too where applicable

2) if I run the command to get the bash autocompletion functionality:

openstack complete > /etc/bash_completion.d/osc.bash_completion

It is indeed influenced by the settings described in 1). So that for example I get or not the autocompletion features for the V3 "domain" and "group" commands, depending on the shell settings of the session where I run it...

All of this for sure can be seen as a feature, but it created many headaches in my cli experience. Just to share with others that could be impacted.

Final question comes now: how can I set, if possible, a Queen environment so that by default it uses V3 context in "openstack" commands, without necessarily setting env vars? Thanks, Gianluca

edit retag flag offensive close merge delete

Comments

Yes, what you experience is a feature, not a bug.

To simplify environment variables or command line options, you can use a variation of clouds.yaml.

Bernd Bausch gravatar imageBernd Bausch ( 2020-08-06 16:51:01 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-08-07 04:25:27 -0600

tekkafedora gravatar image

updated 2020-08-07 09:54:25 -0600

I give an answer instead of replying to Bernd comment, because it more usable for code and such. Thanks for the suggestion about clouds.yaml, but it seems it doesn't work as expected. Only tried on RH OSP 13 (based on Queen), not pure Queens right now. I tried what suggested in example page in a shell session without any env var set but I get messages regarding "ignoring domain related config parameters because identity api version is 2.0" if I use "openstack --os-cloud overcloud image list" Even if I try to use something like this, inserting what I have in my v3 rc file:

clouds:
  overcloud:
    auth:
      auth_url: http://my_controller:5000/v3
      project_name: my_project
      project_domain_name: Default
      username: my_user      
      username_domain_name: mylab
      password: my_password
    region_name: RegionOne

I get the same errors.... and HTTP-400 result And if I put also identity_api_version: 3 I get "unexpected keyword argument "identity_api_version"


What it works is using a clouds.yaml file of this type (with port 35357 it doesn't work; and using port 5000 it is not necessary to specify /v3):

clouds:
  overcloud:
    auth:
      auth_url: http://my_controller:5000
      project_name: my_project
      project_domain_name: Default
      username: my_user      
      username_domain_name: mylab
      password: my_password
    region_name: RegionOne

and then call the command also specifying the identity api version in the command line:

openstack --os-identity-api-version 3 --os-cloud overcloud image list

So at the end it doesn't seem to solve the original problem of bypassing not using API v3... unless I find a way to specify in clouds.yaml to use it...

edit flag offensive delete link more

Comments

It's not quite clear what you do. I understand that the above clouds.yaml file leads to an error "... identity api version is 2.0", which doesn't make sense to me.

The example page suggests a lot of things. Which suggestion did you follow?

You say you set identity_api_version. In which line?

Bernd Bausch gravatar imageBernd Bausch ( 2020-08-07 06:06:05 -0600 )edit

I first tried based on the first example of the web page for the "devstack" cloud, adding also my user_domain_name and project_domain_name settings and using "auth_url: http://my_controller:35357/%22 (http://my_controller:35357/"). It failed with the API v2 message so I tried using :5000/v3 for the auth_url with same results

tekkafedora gravatar imagetekkafedora ( 2020-08-07 09:40:52 -0600 )edit

and finally trying to add the identity_api_version at the auth_url level but I got unknown keyword. It seems like without env var it tries anyway to use V2...

tekkafedora gravatar imagetekkafedora ( 2020-08-07 09:42:20 -0600 )edit

I think that the identity API version needs to be set outside of the auth paragraph. Source: Another clouds.yaml file I have found. What I have not found is documentation of the syntax of the file.

Bernd Bausch gravatar imageBernd Bausch ( 2020-08-07 17:33:02 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2020-08-06 09:28:04 -0600

Seen: 37 times

Last updated: Aug 07 '20