ERROR (CommandError): You must provide a username or user id via --os-username, --os-user-id, env[OS_USERNAME] or env[OS_USER_ID]

asked 2015-01-22 03:43:17 -0600

Queen gravatar image

updated 2015-01-22 03:43:57 -0600

I have created two nodes compute and controller node.Now i m having a query how to create a VM on compute node through compute node.the above error was caught when i itried to run the command "nova flavor-list".So plz anyone can guide me to create VM on compute node through controller node.. and als o why this error is occuring ..

Thank you in advance..

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted

answered 2015-01-22 04:11:33 -0600

your auth_credentials are not mapping correctly to keystone commands.

for the first user better you set environmental variables like OS_SERVICE_TOKEN and OS_SERVICE_ENDPOINT by the following command.

openssl rand -hex 10  (this will produce a 10 digit key copy it) then type
export OS_SERVICE_TOKEN=10 digit key   
export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0

if this works properly then for second time onwards you have to create filef first. then execute the following command

keystone --os-username=admin --os-password=ADMIN_PASS --os-auth-url=http://controller:35357/v2.0 token-get

this returns a token with name and id generated randomly (don't panic output would be bigger than your screen) after that run the below command

keystone --os-username=admin --os-password=ADMIN_PASS --os-tenant-name=admin --os-auth-url=http://controller:35357/v2.0 \

now copy the credentials to your admin-openrc file

export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://controller:35357/v2.0

just remember where you create this file its better to create it in /etc/keystone then source it by the command


you have to source this everytime if you restart your system

edit flag offensive delete link more


the details above are according to icehouse. if you using Juno then map the things properly

PradeepNaik gravatar imagePradeepNaik ( 2015-01-22 04:14:05 -0600 )edit

yeah..i m usin juno .why would we need the openssl command. i tried all the commans but im getin the vfollowing error. ERROR (CommandError): Invalid OpenStack Nova credintials.

Queen gravatar imageQueen ( 2015-01-23 03:37:16 -0600 )edit

why do we need token

Queen gravatar imageQueen ( 2015-01-23 03:37:31 -0600 )edit

Thanks! This helped. I just downloaded the from the panel and copied it to /etc/keystone. Do I have to copy this to every controller? and can I add a script to rc.local so it will source on boot?

5-jason-h gravatar image5-jason-h ( 2015-10-10 23:21:42 -0600 )edit

answered 2015-01-22 11:19:06 -0600

Amitabh Sinha gravatar image

updated 2015-01-23 05:36:34 -0600

image descriptionThis error comes when you are not authenticated. you can solve this error in two ways 1, source your creds admin file. which will be in the controller node. source creds admin Now I have attached screenshot PLEASE go through it. the creds-admin file and do export SERVICE_TOKEN=ADMIN export SERVICE_ENDPOINT="http://${HOST_IP}:35357/v2.0"

now you can execute any command prior to your congifuration.

Hope it resolves youur problem.

edit flag offensive delete link more


ERROR (CommandError): Invalid OpenStack Nova credintials after trying above command getting this error

Queen gravatar imageQueen ( 2015-01-23 03:34:57 -0600 )edit

you have to run that command in controller node. RUN source creds admin. hope it will resolve your issue now!

Amitabh Sinha gravatar imageAmitabh Sinha ( 2015-01-23 05:28:51 -0600 )edit

answered 2015-01-22 03:56:23 -0600

9lives gravatar image

updated 2015-01-22 03:56:50 -0600

OpenStack uses keystone to do Authentication, the error indicate that you have not provided user credentials(username, password) as well as the keystone endpoint, you need to provide these information like this:


then execute the nova flavor-list.

Hope that helps!


edit flag offensive delete link more

answered 2015-01-23 03:44:42 -0600

Queen gravatar image

updated 2015-01-23 04:04:54 -0600

thank you 9lives ,Pradeep,and amitabh it worked.. Could you plz help me to solve the seconquestion mentioned in the description of above question.Thank you in advance.

edit flag offensive delete link more


hello queen. i guess your second question is VM creation. if the previous issues is resolved and all your services are up and running you can directly go for launch instance. from installation docs

PradeepNaik gravatar imagePradeepNaik ( 2015-01-23 04:19:18 -0600 )edit

my previous issue has been solved.but i m not able to see to two node on my dashboard.

Queen gravatar imageQueen ( 2015-01-23 07:00:49 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2015-01-22 03:43:17 -0600

Seen: 31,427 times

Last updated: Jan 23 '15