0

I'm setting up Openstack on some machines. I was following this guide http://docs.openstack.org/liberty/install-guide-ubuntu/ until I ran into this problem:

When I'm verifying Image service (Glance), I got the following problem:

$ cat admin-openrc.sh 
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=passw0rd
export OS_AUTH_URL=http://Renaissance:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
$ source admin-openrc.sh
$ glance --debug image-create --name "cirros" \
>   --file cirros-0.3.4-x86_64-disk.img \
>   --disk-format qcow2 --container-format bare \
>   --visibility public --progress
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}7ce8d893ef6cdaca2ed5a876c8211a841455ba65' -H 'Content-Type: application/octet-stream' http://Renaissance:9292/v2/schemas/image
Request returned failure status 401.
Invalid OpenStack Identity credentials.

I would get same error using any other glance function (e.g. glance image-list).

I think I'm having my configurations correct since I followed the guide. Here's my Openstack services, projects, users, roles and endpoints

+----------------------------------+----------+----------+
| ID                               | Name     | Type     |
+----------------------------------+----------+----------+
| bf585630a5cb475b9e883493de3813fa | glance   | image    |
| fc29e468dae849e6afb97ecc3bf487f6 | keystone | identity |
+----------------------------------+----------+----------+
+----------------------------------+----------+
| ID                               | Name     |
+----------------------------------+----------+
| 0bc473b2e77a4a9bb7871ed2afacb995 | admin    |
| dcaf480621164c409b6704c3f42e0869 | service  |
| e9f709d860fe46e2819b6bf1c78ccd0f | nonadmin |
+----------------------------------+----------+
+----------------------------------+----------+
| ID                               | Name     |
+----------------------------------+----------+
| 485374adcbe54ce5b9ef465b84aa2c9f | admin    |
| 7447f4cd56f64ccfb111cba74f9a4b92 | nonadmin |
| d9ffc32240d24328b10af8b2550ec414 | glance   |
+----------------------------------+----------+
+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| 466fea231ef54d3ca4564fb42f51bb5c | admin |
| a36c726d27f04ebf92d336c3acfcd945 | user  |
+----------------------------------+-------+
+----------------------------------+-----------+--------------+--------------+---------+-----------+-------------------------------+
| ID                               | Region    | Service Name | Service Type | Enabled | Interface | URL                           |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-------------------------------+
| 01f62a7b9f7f4fa782e8bc695e74afc1 | RegionOne | glance       | image        | True    | internal  | http://Renaissance:9292       |
| abb7e5052d8646428e82ef58ca21b376 | RegionOne | keystone     | identity     | True    | public    | http://Renaissance:5000/v2.0  |
| d5b3180255b44a0eafe0810a20e104bc | RegionOne | glance       | image        | True    | public    | http://Renaissance:9292       |
| e0392842c6f64ac389a5688bc2581192 | RegionOne | keystone     | identity     | True    | internal  | http://Renaissance:5000/v2.0  |
| e0eb3dd0ed774669bce9a74dd3831c05 | RegionOne | keystone     | identity     | True    | admin     | http://Renaissance:35357/v2.0 |
| ec855dca8f87454e997fd55c47f17703 | RegionOne | glance       | image        | True    | admin     | http://Renaissance:9292       |
+----------------------------------+-----------+--------------+--------------+---------+-----------+-------------------------------+

My auth configuration of glance (in glance-api.conf and glance-registry.conf) is listed below:

...
[keystone_authtoken]
# Complete public Identity API endpoint. (string value)
auth_uri = http://Renaissance:5000
auth_uri = http://Renaissance:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = passw0rd
...

And I can get token using Openstack:

$ openstack token issue
+------------+----------------------------------+
| Field      | Value                            |
+------------+----------------------------------+
| expires    | 2016-10-01T01:16:48.482839Z      |
| id         | 2a4e052a2c4140a28f550158d95ecd3b |
| project_id | 0bc473b2e77a4a9bb7871ed2afacb995 |
| user_id    | 485374adcbe54ce5b9ef465b84aa2c9f |
+------------+----------------------------------+

I'm guessing its the api version problem, but I've been changing the version number in the uri but it didn't work. Any help is appreciated. Thanks!

Oriki
  • 1
  • 1

1 Answers1

0

in your glance configuration, the project name is service, but your env var project name is admin.

solutions:

  • ensure passw0rd is the real pw to glance:service account
  • change glance conf to use admin project instead
ZhiQiang Fan
  • 986
  • 6
  • 7
  • I am aware that it might be the project name I got wrong and I tried to use project `service`.I have a role for user `glance` in project `service`: `$ openstack role list --user glance --project service | ID | Name | Project | User | | 466fea231ef54d3ca4564fb42f51bb5c | admin | service | glance |` – Oriki Oct 10 '16 at 22:54
  • I have also make a `glance_openrc.sh` to source with these difference from `admin_openrc.sh`: `export OS_PROJECT_NAME=service export OS_TENANT_NAME=service export OS_USERNAME=glance`. While it still not working with same error. I'm sure I have my password right. – Oriki Oct 10 '16 at 23:02