GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu14.04.2でのOpenStackKilo– KeyStone#2の構成

このガイドでは、コントローラーノードでのOpenStack Identity Serviceの構成の2番目の部分に進みます。また、KeyStone#1の構成に関する前の記事も参照できます。ここでは、サービスエンティティとAPIエンドポイントの作成について説明します。

サービスエンティティとAPIエンドポイントを作成します:

サービスエンティティとAPIエンドポイントを作成するには、以下の変数をエクスポートして認証トークンの値を渡す必要があります。

# export OS_TOKEN=43405b090eda983ddde2  ## Replace this token (43405b090eda983ddde2 ) with OS_TOEKEN value from keystone.conf file.
# export OS_URL=http://controller:35357/v2.0  ## Replace controller with your controller ip.

Identityサービスのサービスエンティティを作成します。

# openstack service create --name keystone --description "OpenStack Identity" identity

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

サービスを確認します。

# openstack service list
+----------------------------------+----------+----------+
| ID                               | Name     | Type     |
+----------------------------------+----------+----------+
| c65841b4f8df478cbc19524c09fd9724 | keystone | identity |
+----------------------------------+----------+----------+

IdentityServiceAPIエンドポイントを作成します。

# openstack endpoint create \
--publicurl http://controller:5000/v2.0 \
--internalurl http://controller:5000/v2.0 \
--adminurl http://controller:35357/v2.0 \
--region RegionOne \
identity
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| adminurl     | http://controller:35357/v2.0     |
| id           | f402a9389d474c13a97a78a30f13c6e5 |
| internalurl  | http://controller:5000/v2.0      |
| publicurl    | http://controller:5000/v2.0      |
| region       | RegionOne                        |
| service_id   | c65841b4f8df478cbc19524c09fd9724 |
| service_name | keystone                         |
| service_type | identity                         |
+--------------+----------------------------------+

エンドポイントの詳細を確認します。

# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+
| ID                               | Region    | Service Name | Service Type |
+----------------------------------+-----------+--------------+--------------+
| f402a9389d474c13a97a78a30f13c6e5 | RegionOne | keystone     | identity     |
+----------------------------------+-----------+--------------+--------------+

プロジェクト、ユーザー、役割を作成する:

管理プロジェクト、管理用のユーザーと役割を作成します。簡単にするためにデフォルトのドメインを使用します。

管理プロジェクトを作成します。

# openstack project create --description "Admin Project" admin
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Admin Project                    |
| enabled     | True                             |
| id          | 9b05e6bffdb94c8081d665561d05e31e |
| name        | admin                            |
+-------------+----------------------------------+

管理者ユーザーを作成します。

# openstack user create --password-prompt admin
User Password:
Repeat User Password:
+----------+----------------------------------+
| Field    | Value                            |
+----------+----------------------------------+
| email    | None                             |
| enabled  | True                             |
| id       | 127a9a6b822a4e3eba69fa54128873cd |
| name     | admin                            |
| username | admin                            |
+----------+----------------------------------+

管理者の役割を作成します。

# openstack role create admin
+-------+----------------------------------+
| Field | Value                            |
+-------+----------------------------------+
| id    | 33af4f957aa34cc79451c23bf014af6f |
| name  | admin                            |
+-------+----------------------------------+

管理プロジェクトとユーザーに管理者の役割を追加します。

# openstack role add --project admin --user admin admin
+-------+----------------------------------+
| Field | Value                            |
+-------+----------------------------------+
| id    | 33af4f957aa34cc79451c23bf014af6f |
| name  | admin                            |
+-------+----------------------------------+

サービスプロジェクトを作成します。

# openstack project create --description "Service Project" service
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Service Project                  |
| enabled     | True                             |
| id          | 39e1b9944e564ceb9e71c98623b676cd |
| name        | service                          |
+-------------+----------------------------------+

通常のユーザーに使用するデモプロジェクトを作成します。

#  openstack project create --description "Demo Project" demo
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Demo Project                     |
| enabled     | True                             |
| id          | 909c4d7219c14a63aa0ef6f1ece18546 |
| name        | demo                             |
+-------------+----------------------------------+

デモユーザーを作成します。

# openstack user create --password-prompt demo
User Password:
Repeat User Password:
+----------+----------------------------------+
| Field    | Value                            |
+----------+----------------------------------+
| email    | None                             |
| enabled  | True                             |
| id       | 453ce23fa9f347b5baa53210aff7f207 |
| name     | demo                             |
| username | demo                             |
+----------+----------------------------------+

ユーザーロールを作成します。

# openstack role create user
+-------+----------------------------------+
| Field | Value                            |
+-------+----------------------------------+
| id    | fa78c101a7ed40b19de219e7d3eeda62 |
| name  | user                             |
+-------+----------------------------------+

デモプロジェクトとユーザーにユーザーロールを追加します。

# openstack role add --project demo --user demo user
+-------+----------------------------------+
| Field | Value                            |
+-------+----------------------------------+
| id    | fa78c101a7ed40b19de219e7d3eeda62 |
| name  | user                             |
+-------+----------------------------------+

操作の確認:

# openstack project list
+----------------------------------+---------+
| ID                               | Name    |
+----------------------------------+---------+
| 39e1b9944e564ceb9e71c98623b676cd | service |
| 909c4d7219c14a63aa0ef6f1ece18546 | demo    |
| 9b05e6bffdb94c8081d665561d05e31e | admin   |
+----------------------------------+---------+
# openstack user list
+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| 127a9a6b822a4e3eba69fa54128873cd | admin |
| 453ce23fa9f347b5baa53210aff7f207 | demo  |
+----------------------------------+-------+
# openstack role list
+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| 33af4f957aa34cc79451c23bf014af6f | admin |
| fa78c101a7ed40b19de219e7d3eeda62 | user  |
+----------------------------------+-------+

ロールベースのアクセスで動作を確認し、エクスポートされた変数の設定を解除します。

# unset OS_TOKEN OS_URL

次のコマンドを実行して、管理者ユーザーとしての役割を一覧表示します。

# openstack --os-auth-url http://controller:35357 --os-project-name admin --os-username admin --os-auth-type password  role list
Password:
+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| 33af4f957aa34cc79451c23bf014af6f | admin |
| fa78c101a7ed40b19de219e7d3eeda62 | user  |
+----------------------------------+-------+

次のコマンドを実行して、デモユーザーとしての役割を一覧表示します。以下のエラーが発生するはずです。

# openstack --os-auth-url http://controller:35357 --os-project-name demo --os-username demo --os-auth-type password role list
Password:
ERROR: openstack You are not authorized to perform the requested action: admin_required (HTTP 403) (Request-ID: req-143ee967-4a26-4474-bf88-0b660354869d)

これで、Ubuntu14.04.2でKeyStoneを正常に構成できました


Ubuntu
  1. Ubuntu14.04LTSでのOpenStackLiberty–Novaの構成

  2. Ubuntu14.04.2でのOpenStackKilo– Neutron#1の構成

  3. Ubuntu14.04.2でのOpenStackKilo–Novaの構成

  1. Ubuntu14.04.2上のOpenStackKilo–Glanceの構成

  2. Ubuntu14.04.2でのOpenStackKilo– KeyStone#1の構成

  3. Ubuntu14.04.2にOpenStackKiloをインストールします

  1. Ubuntu14.04.2でのOpenStackKilo– Swift#1の構成

  2. Ubuntu14.04.2でのOpenStackKilo– Cinder#2の構成

  3. Ubuntu14.04.2でのOpenStackKilo– Cinder#1の構成