Ubuntu 14.04
Sponsored Link

OpenStack Mitaka (三鷹) : Keystone 設定#2
2016/04/20
 
Keystone に ユーザやロール、OpenStack 各コンポーネントが利用するサービスを登録しておきます。
[1] 環境変数を事前に読み込んでおきます。
「OS_TOKEN」は keystone.conf で「admin_token」に設定した値
「OS_URL」は Keystone サーバーのホスト名またはIPアドレス
root@dlp:~#
export OS_TOKEN=admintoken

root@dlp:~#
export OS_URL=http://10.0.0.30:35357/v3

root@dlp:~#
export OS_IDENTITY_API_VERSION=3

root@dlp:~#
openstack domain create --description "Default Domain" default

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Default Domain                   |
| enabled     | True                             |
| id          | e547aee8ce3a44958e7a53b32f2bd0ae |
| name        | default                          |
+-------------+----------------------------------+
[2] プロジェクトを作成します。
# admin プロジェクト作成

root@dlp:~#
openstack project create --domain default --description "Admin Project" admin

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Admin Project                    |
| domain_id   | e547aee8ce3a44958e7a53b32f2bd0ae |
| enabled     | True                             |
| id          | 7b165caeb26a40eb8b26063b013ad26a |
| is_domain   | False                            |
| name        | admin                            |
| parent_id   | e547aee8ce3a44958e7a53b32f2bd0ae |
+-------------+----------------------------------+

# service プロジェクト作成

root@dlp:~#
openstack project create --domain default --description "Service Project" service

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Service Project                  |
| domain_id   | e547aee8ce3a44958e7a53b32f2bd0ae |
| enabled     | True                             |
| id          | 0aa29b9e087e44358ca8a598b4ef39b4 |
| is_domain   | False                            |
| name        | service                          |
| parent_id   | e547aee8ce3a44958e7a53b32f2bd0ae |
+-------------+----------------------------------+

# 設定確認

root@dlp:~#
openstack project list

+----------------------------------+---------+
| ID                               | Name    |
+----------------------------------+---------+
| 0aa29b9e087e44358ca8a598b4ef39b4 | service |
| 7b165caeb26a40eb8b26063b013ad26a | admin   |
+----------------------------------+---------+
[3] ロールを作成します。
# admin ロール作成

root@dlp:~#
openstack role create admin

+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | 84f993a4da624ce8b5fb08459942006d |
| name      | admin                            |
+-----------+----------------------------------+

# Member ロール作成

root@dlp:~#
openstack role create Member

+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | 20d83bc6bed449d99fd570fbe9d4ce6b |
| name      | Member                           |
+-----------+----------------------------------+

# 設定確認

root@dlp:~#
openstack role list

+----------------------------------+--------+
| ID                               | Name   |
+----------------------------------+--------+
| 20d83bc6bed449d99fd570fbe9d4ce6b | Member |
| 84f993a4da624ce8b5fb08459942006d | admin  |
+----------------------------------+--------+
[4] ユーザーを作成します。
# admin ユーザー作成 (admin プロジェクト所属)

root@dlp:~#
openstack user create --domain default --project admin --password adminpassword admin

+--------------------+----------------------------------+
| Field              | Value                            |
+--------------------+----------------------------------+
| default_project_id | 7b165caeb26a40eb8b26063b013ad26a |
| domain_id          | e547aee8ce3a44958e7a53b32f2bd0ae |
| enabled            | True                             |
| id                 | bffe2db8216d4706862b53a4380e8634 |
| name               | admin                            |
+--------------------+----------------------------------+

# admin ユーザーを admin ロール に加える

root@dlp:~#
openstack role add --project admin --user admin admin
# 設定確認

root@dlp:~#
openstack user list

+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| bffe2db8216d4706862b53a4380e8634 | admin |
+----------------------------------+-------+
[5] サービス用のエントリを作成します。
# keystone 用サービスエントリ作成

root@dlp:~#
openstack service create --name keystone --description "OpenStack Identity" identity

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Identity               |
| enabled     | True                             |
| id          | e18211dbdcc4428e9d73b032bc442aaf |
| name        | keystone                         |
| type        | identity                         |
+-------------+----------------------------------+

# 設定確認

root@dlp:~#
openstack service list

+----------------------------------+----------+----------+
| ID                               | Name     | Type     |
+----------------------------------+----------+----------+
| e18211dbdcc4428e9d73b032bc442aaf | keystone | identity |
+----------------------------------+----------+----------+
[6] エンドポイントを作成します。
# 自ホストを定義しておく

root@dlp:~#
export controller=10.0.0.30
# keystone 用エンドポイント作成 (public)

root@dlp:~#
openstack endpoint create --region RegionOne identity public http://$controller:5000/v3

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | d38c323d39fb4ce38278b01e514d2099 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | e18211dbdcc4428e9d73b032bc442aaf |
| service_name | keystone                         |
| service_type | identity                         |
| url          | http://10.0.0.30:5000/v3         |
+--------------+----------------------------------+

# keystone 用エンドポイント作成 (internal )

root@dlp:~#
openstack endpoint create --region RegionOne identity internal http://$controller:5000/v3

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 71b8e4fe6ad641d1996e2e4f1eec6792 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | e18211dbdcc4428e9d73b032bc442aaf |
| service_name | keystone                         |
| service_type | identity                         |
| url          | http://10.0.0.30:5000/v3         |
+--------------+----------------------------------+

# keystone 用エンドポイント作成 (admin )

root@dlp:~#
openstack endpoint create --region RegionOne identity admin http://$controller:35357/v3

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | dbc6ec5b2f7741ef96b6f3a1846d8d01 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | e18211dbdcc4428e9d73b032bc442aaf |
| service_name | keystone                         |
| service_type | identity                         |
| url          | http://10.0.0.30:35357/v3        |
+--------------+----------------------------------+

# 設定確認

root@dlp:~#
openstack endpoint list

+----------------------------------+-----------+--------------+--------------+---------+-----------+---------------------------+
| ID                               | Region    | Service Name | Service Type | Enabled | Interface | URL                       |
+----------------------------------+-----------+--------------+--------------+---------+-----------+---------------------------+
| 71b8e4fe6ad641d1996e2e4f1eec6792 | RegionOne | keystone     | identity     | True    | internal  | http://10.0.0.30:5000/v3  |
| d38c323d39fb4ce38278b01e514d2099 | RegionOne | keystone     | identity     | True    | public    | http://10.0.0.30:5000/v3  |
| dbc6ec5b2f7741ef96b6f3a1846d8d01 | RegionOne | keystone     | identity     | True    | admin     | http://10.0.0.30:35357/v3 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+---------------------------+
関連コンテンツ
 
Tweet