OpenStack Icehouse : Keystone 設定#22014/05/13 |
Keystone に ユーザやロール、OpenStack 各コンポーネントが利用するサービスを登録しておきます。
|
|
[1] | 環境変数を事前に読み込んでおく 「SERVICE_TOKEN」はkeystone.conf で「admin_token」に設定した値 「SERVICE_ENDPOINT」は Keystoneサーバーのホスト名またはIPアドレス |
root@dlp:~# export SERVICE_TOKEN=admintoken root@dlp:~# export SERVICE_ENDPOINT=http://10.0.0.30:35357/v2.0/ |
[2] | テナント(グループ)を作成する |
# admin テナント作成 root@dlp:~# keystone tenant-create --name admin --description "Admin Tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Admin Tenant | | enabled | True | | id | 0bf06fa0415043cb924ead3db08e2518 | | name | admin | +-------------+----------------------------------+ # service テナント作成 root@dlp:~# keystone tenant-create --name service --description "Service Tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Service Tenant | | enabled | True | | id | 45fa65597c464d48a20be990f660a27b | | name | service | +-------------+----------------------------------+ # 設定確認 root@dlp:~# keystone tenant-list +----------------------------------+---------+---------+ | id | name | enabled | +----------------------------------+---------+---------+ | 0bf06fa0415043cb924ead3db08e2518 | admin | True | | 45fa65597c464d48a20be990f660a27b | service | True | +----------------------------------+---------+---------+ |
[3] | ロールを作成する |
# admin ロール作成 root@dlp:~# keystone role-create --name admin +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | id | 9b5fb09c8f8d4271ae30d445794299c5 | | name | admin | +----------+----------------------------------+ # Member ロール作成 root@dlp:~# keystone role-create --name Member +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | id | 2fa81c7f476748e89e6806cfadeea5cf | | name | Member | +----------+----------------------------------+ # 設定確認 root@dlp:~# keystone role-list +----------------------------------+----------+ | id | name | +----------------------------------+----------+ | 2fa81c7f476748e89e6806cfadeea5cf | Member | | 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | | 9b5fb09c8f8d4271ae30d445794299c5 | admin | +----------------------------------+----------+ |
[4] | ユーザーを作成する |
# admin ユーザー作成 (admin テナント所属) root@dlp:~# keystone user-create --tenant admin --name admin --pass adminpassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | dd7518983aac411a9b24be64e6fa220f | | name | admin | | tenantId | 0bf06fa0415043cb924ead3db08e2518 | | username | admin | +----------+----------------------------------+ # admin ユーザーを adminロール に加える root@dlp:~# keystone user-role-add --user admin --tenant admin --role admin
# glance ユーザー作成 (service テナント所属) root@dlp:~# keystone user-create --tenant service --name glance --pass servicepassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | bf57c97785d44d658da80f6414ba9e66 | | name | glance | | tenantId | 45fa65597c464d48a20be990f660a27b | | username | glance | +----------+----------------------------------+ # glance ユーザーを adminロール に加える root@dlp:~# keystone user-role-add --user glance --tenant service --role admin
# nova ユーザー作成 (service テナント) root@dlp:~# keystone user-create --tenant service --name nova --pass servicepassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | f9713827b52040328749fa810b15d0ed | | name | nova | | tenantId | 45fa65597c464d48a20be990f660a27b | | username | nova | +----------+----------------------------------+ # nova ユーザーを adminロール に加える root@dlp:~# keystone user-role-add --user nova --tenant service --role admin
# 設定確認 root@dlp:~# keystone user-list +----------------------------------+--------+---------+-------+ | id | name | enabled | email | +----------------------------------+--------+---------+-------+ | dd7518983aac411a9b24be64e6fa220f | admin | True | | | bf57c97785d44d658da80f6414ba9e66 | glance | True | | | f9713827b52040328749fa810b15d0ed | nova | True | | +----------------------------------+--------+---------+-------+ |
[5] | サービス用のエントリを作成する |
# keystone用サービスエントリ作成 root@dlp:~# keystone service-create --name=keystone --type=identity --description="Keystone Identity Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Keystone Identity Service | | enabled | True | | id | 57a1dad6cdcd4ec5a6e96862edd8d7bd | | name | keystone | | type | identity | +-------------+----------------------------------+ # glance用サービスエントリ作成 root@dlp:~# keystone service-create --name=glance --type=image --description="Glance Image Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Glance Image Service | | enabled | True | | id | daf11cbfbabb45d3a1408132a90af89e | | name | glance | | type | image | +-------------+----------------------------------+ # nova用サービスエントリ作成 root@dlp:~# keystone service-create --name=nova --type=compute --description="Nova Compute Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Nova Compute Service | | enabled | True | | id | 585abf4e7ca94fdba9618e41e6ae394e | | name | nova | | type | compute | +-------------+----------------------------------+ # 設定確認 root@dlp:~# keystone service-list +----------------------------------+----------+----------+---------------------------+ | id | name | type | description | +----------------------------------+----------+----------+---------------------------+ | daf11cbfbabb45d3a1408132a90af89e | glance | image | Glance Image Service | | 57a1dad6cdcd4ec5a6e96862edd8d7bd | keystone | identity | Keystone Identity Service | | 585abf4e7ca94fdba9618e41e6ae394e | nova | compute | Nova Compute Service | +----------------------------------+----------+----------+---------------------------+ |
[6] | エンドポイントを作成する |
# 自ホストを定義しておく root@dlp:~# export my_host=10.0.0.30
# keystone 用エンドポイント作成 root@dlp:~# keystone endpoint-create --region RegionOne \ --service keystone \ --publicurl "http://$my_host:\$(public_port)s/v2.0" \ --internalurl "http://$my_host:\$(public_port)s/v2.0" \ --adminurl "http://$my_host:\$(admin_port)s/v2.0" +-------------+---------------------------------------+ | Property | Value | +-------------+---------------------------------------+ | adminurl | http://10.0.0.30:$(admin_port)s/v2.0 | | id | f3d986a2d5fe482b91071bcaca83c94a | | internalurl | http://10.0.0.30:$(public_port)s/v2.0 | | publicurl | http://10.0.0.30:$(public_port)s/v2.0 | | region | RegionOne | | service_id | 57a1dad6cdcd4ec5a6e96862edd8d7bd | +-------------+---------------------------------------+ # glance 用エンドポイント作成 root@dlp:~# keystone endpoint-create --region RegionOne \ --service glance \ --publicurl "http://$my_host:9292/v1" \ --internalurl "http://$my_host:9292/v1" \ --adminurl "http://$my_host:9292/v1" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://10.0.0.30:9292/v1 | | id | e2ba460ae291487fadf33f96b6bc56dd | | internalurl | http://10.0.0.30:9292/v1 | | publicurl | http://10.0.0.30:9292/v1 | | region | RegionOne | | service_id | daf11cbfbabb45d3a1408132a90af89e | +-------------+----------------------------------+ # nova 用エンドポイント作成 root@dlp:~# keystone endpoint-create --region RegionOne \ --service nova \ --publicurl "http://$my_host:\$(compute_port)s/v2/\$(tenant_id)s" \ --internalurl "http://$my_host:\$(compute_port)s/v2/\$(tenant_id)s" \ --adminurl "http://$my_host:\$(compute_port)s/v2/\$(tenant_id)s" +-------------+----------------------------------------------------+ | Property | Value | +-------------+----------------------------------------------------+ | adminurl | http://10.0.0.30:$(compute_port)s/v2/$(tenant_id)s | | id | 530d64cee22d4dff89e97bada01e4886 | | internalurl | http://10.0.0.30:$(compute_port)s/v2/$(tenant_id)s | | publicurl | http://10.0.0.30:$(compute_port)s/v2/$(tenant_id)s | | region | RegionOne | | service_id | 585abf4e7ca94fdba9618e41e6ae394e | +-------------+----------------------------------------------------+ # 設定確認 root@dlp:~# keystone endpoint-list +----------------------------------+-----------+----------------------------------------------------+ | id | region | publicurl | +----------------------------------+-----------+----------------------------------------------------+ | 530d64cee22d4dff89e97bada01e4886 | RegionOne | http://10.0.0.30:$(compute_port)s/v2/$(tenant_id)s | | e2ba460ae291487fadf33f96b6bc56dd | RegionOne | http://10.0.0.30:9292/v1 | | f3d986a2d5fe482b91071bcaca83c94a | RegionOne | http://10.0.0.30:$(public_port)s/v2.0 | +----------------------------------+-----------+----------------------------------------------------+ +----------------------------------------------------+ | internalurl | +----------------------------------------------------+ | http://10.0.0.30:$(compute_port)s/v2/$(tenant_id)s | | http://10.0.0.30:9292/v1 | | http://10.0.0.30:$(public_port)s/v2.0 | +----------------------------------------------------+ +----------------------------------------------------+----------------------------------+ | adminurl | service_id | +----------------------------------------------------+----------------------------------+ | http://10.0.0.30:$(compute_port)s/v2/$(tenant_id)s | 585abf4e7ca94fdba9618e41e6ae394e | | http://10.0.0.30:9292/v1 | daf11cbfbabb45d3a1408132a90af89e | | http://10.0.0.30:$(admin_port)s/v2.0 | 57a1dad6cdcd4ec5a6e96862edd8d7bd | +----------------------------------------------------+----------------------------------+ |
Sponsored Link |
|