Expecting an auth URL via either error thrown openstack

2.9k views Asked by At
ubuntu@ubuntu-14-lts:~$ export OS_USERNAME=admin
ubuntu@ubuntu-14-lts:~$ export OS_TENANT_NAME=admin
ubuntu@ubuntu-14-lts:~$ export OS_PASSWORD=admin
ubuntu@ubuntu-14-lts:~$ export OS_AUTH_URL=http://localhost:35357/v2.0/

Executed the command to create the Admin tenant

ubuntu@ubuntu-14-lts:~$ sudo keystone tenant-create --name admin --description "Admin Tenant"

got the below error

Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL]

modified the url

ubuntu@ubuntu-14-lts:~$ export OS_AUTH_URL="http://localhost:35357/v2.0/"

re-run the same command and same error thrown

ubuntu@ubuntu-14-lts:~$ sudo keystone tenant-create --name admin --description "Admin Tenant"

Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL]

Is there any Issues in running the command ?

2

There are 2 answers

0
Barak On

The issue is probably with sudo - sudo may not maintain environment variables. Depends on configuration.

Why do you need sudo anyway? The keystone command does not require it. Either drop sudo, or add

--os-auth-url http://localhost:35357/v2.0/

to your command. You can also do

sudo -e keystone ...
0
Himanshu Saikia On

You have failed to create a new user or tenant because you have no access to keystone... just like you need to login to mysql to create new tables and all, the same is here. The following steps will help you through:

  1. # unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT
  2. # keystone --os-username=ADMIN_USERNAME --os-password=ADMIN_PASSWORD --os-auth-url=http://controller:35357/v2.0 token-get
  3. # source admin_creds //this is the file where you have saved the admin credentials
  4. # keystone token-get
  5. # source creds // this is the other file where you have backed up your admin credentials
  6. now you can run your keystone commands normally. Please put a tick mark if it helped you! lol