OpenStack Grizzly - Keystone 設定#22013/08/13 |
Keystone に ユーザやロール、OpenStack 各コンポーネントが利用するサービスを登録しておきます。
|
|
[1] | 環境変数を事前に読み込んでおく 「SERVICE_TOKEN」はkeystone.conf で「admin_token」に設定した値 |
[root@dlp ~]# export SERVICE_TOKEN=admintoken [root@dlp ~]# export SERVICE_ENDPOINT=http://127.0.0.1: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 | 2751413388064becb657e04afc0e7695 | | name | admin | +-------------+----------------------------------+ # service テナント作成 [root@dlp ~]# keystone tenant-create --name service --description "Service Tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Service Tenant | | enabled | True | | id | a2ce1b64a0b742f68110edf193e30af7 | | name | service | +-------------+----------------------------------+ # 設定確認 [root@dlp ~]# keystone tenant-list +----------------------------------+---------+---------+ | id | name | enabled | +----------------------------------+---------+---------+ | 2751413388064becb657e04afc0e7695 | admin | True | | a2ce1b64a0b742f68110edf193e30af7 | service | True | +----------------------------------+---------+---------+ |
[3] | ロールを作成する |
# admin ロール作成 [root@dlp ~]# keystone role-create --name admin +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | id | 2f068e6dd2074674b8fdd2d0bccb32ff | | name | admin | +----------+----------------------------------+ # Member ロール作成 [root@dlp ~]# keystone role-create --name Member +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | id | 88900b30d29845ccbc5ff01a71e37d49 | | name | Member | +----------+----------------------------------+ # 設定確認 [root@dlp ~]# keystone role-list +----------------------------------+----------+ | id | name | +----------------------------------+----------+ | 88900b30d29845ccbc5ff01a71e37d49 | Member | | 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | | 2f068e6dd2074674b8fdd2d0bccb32ff | admin | +----------------------------------+----------+ |
[4] | ユーザーを作成する |
# admin ユーザー作成 (admin テナント) [root@dlp ~]# keystone user-create --tenant_id 2751413388064becb657e04afc0e7695 --name admin --pass adminpassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | c44c8f91d0144fd49471bf89465e9eb0 | | name | admin | | tenantId | 2751413388064becb657e04afc0e7695 | +----------+----------------------------------+ # admin ユーザーを adminロール に加える [root@dlp ~]# keystone user-role-add --user-id c44c8f91d0144fd49471bf89465e9eb0 --tenant_id 2751413388064becb657e04afc0e7695 --role-id 2f068e6dd2074674b8fdd2d0bccb32ff
# cinder ユーザー作成 (service テナント) [root@dlp ~]# keystone user-create --tenant_id a2ce1b64a0b742f68110edf193e30af7 --name cinder --pass servicepassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | 425dc8fdb81241819468c9432a2d4569 | | name | cinder | | tenantId | a2ce1b64a0b742f68110edf193e30af7 | +----------+----------------------------------+ # cinder ユーザーを adminロール に加える [root@dlp ~]# keystone user-role-add --user-id 425dc8fdb81241819468c9432a2d4569 --tenant_id a2ce1b64a0b742f68110edf193e30af7 --role-id 2f068e6dd2074674b8fdd2d0bccb32ff
# glance ユーザー作成 (service テナント) [root@dlp ~]# keystone user-create --tenant_id a2ce1b64a0b742f68110edf193e30af7 --name glance --pass servicepassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | e68a6a08575b4464bba426af4d722538 | | name | glance | | tenantId | a2ce1b64a0b742f68110edf193e30af7 | +----------+----------------------------------+ # glance ユーザーを adminロール に加える [root@dlp ~]# keystone user-role-add --user-id e68a6a08575b4464bba426af4d722538 --tenant_id a2ce1b64a0b742f68110edf193e30af7 --role-id 2f068e6dd2074674b8fdd2d0bccb32ff
# nova ユーザー作成 (service テナント) [root@dlp ~]# keystone user-create --tenant_id a2ce1b64a0b742f68110edf193e30af7 --name nova --pass servicepassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | 0becd68333334ceda6af3c81c33fab4a | | name | nova | | tenantId | a2ce1b64a0b742f68110edf193e30af7 | +----------+----------------------------------+ # nova ユーザーを adminロール に加える [root@dlp ~]# keystone user-role-add --user-id 0becd68333334ceda6af3c81c33fab4a --tenant_id a2ce1b64a0b742f68110edf193e30af7 --role-id 2f068e6dd2074674b8fdd2d0bccb32ff
# 設定確認 [root@dlp ~]# keystone user-list +----------------------------------+--------+---------+-------+ | id | name | enabled | email | +----------------------------------+--------+---------+-------+ | c44c8f91d0144fd49471bf89465e9eb0 | admin | True | | | 425dc8fdb81241819468c9432a2d4569 | cinder | True | | | e68a6a08575b4464bba426af4d722538 | glance | True | | | 0becd68333334ceda6af3c81c33fab4a | nova | True | | +----------------------------------+--------+---------+-------+ |
[5] | サービス用のエントリを作成する |
# keystone用サービスエントリ作成 [root@dlp ~]# keystone service-create --name=keystone --type=identity --description="Keystone Identity Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Keystone Identity Service | | id | 24aa6eb74a3644888d36944a9e4a24b2 | | name | keystone | | type | identity | +-------------+----------------------------------+ # cinder用サービスエントリ作成 [root@dlp ~]# keystone service-create --name=cinder --type=volume --description="Cinder Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Cinder Service | | id | f098586f23374812b8907e4f166507ea | | name | cinder | | type | volume | +-------------+----------------------------------+ # glance用サービスエントリ作成 [root@dlp ~]# keystone service-create --name=glance --type=image --description="Glance Image Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Glance Image Service | | id | a8431d1527354b5a8c1a97b13468f937 | | name | glance | | type | image | +-------------+----------------------------------+ # nova用サービスエントリ作成 [root@dlp ~]# keystone service-create --name=nova --type=compute --description="Nova Compute Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Nova Compute Service | | id | 34e0bd084ae349dfae3f5ede135dea02 | | name | nova | | type | compute | +-------------+----------------------------------+ # 設定確認 [root@dlp ~]# keystone service-list +----------------------------------+----------+----------+---------------------------+ | id | name | type | description | +----------------------------------+----------+----------+---------------------------+ | f098586f23374812b8907e4f166507ea | cinder | volume | Cinder Service | | a8431d1527354b5a8c1a97b13468f937 | glance | image | Glance Image Service | | 24aa6eb74a3644888d36944a9e4a24b2 | keystone | identity | Keystone Identity Service | | 34e0bd084ae349dfae3f5ede135dea02 | nova | compute | Nova Compute Service | +----------------------------------+----------+----------+---------------------------+ |
[6] | エンドポイントを作成する |
# 自ホストを定義しておく [root@dlp ~]# export my_host=127.0.0.1
# keystone 用エンドポイント作成 [root@dlp ~]# keystone endpoint-create --region RegionOne \ --service_id=24aa6eb74a3644888d36944a9e4a24b2 \ --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://127.0.0.1:$(admin_port)s/v2.0 | | id | babc2a40289c4a0898bfbbb18960145d | | internalurl | http://127.0.0.1:$(public_port)s/v2.0 | | publicurl | http://127.0.0.1:$(public_port)s/v2.0 | | region | RegionOne | | service_id | 24aa6eb74a3644888d36944a9e4a24b2 | +-------------+---------------------------------------+ # cinder 用エンドポイント作成 [root@dlp ~]# keystone endpoint-create --region RegionOne \ --service_id=f098586f23374812b8907e4f166507ea \ --publicurl="http://$my_host:8776/v1/\$(tenant_id)s" \ --internalurl="http://$my_host:8776/v1/\$(tenant_id)s" \ --adminurl="http://$my_host:8776/v1/\$(tenant_id)s" +-------------+----------------------------------------+ | Property | Value | +-------------+----------------------------------------+ | adminurl | http://127.0.0.1:8776/v1/$(tenant_id)s | | id | 708244ae6f2742bb9701d696581c8db2 | | internalurl | http://127.0.0.1:8776/v1/$(tenant_id)s | | publicurl | http://127.0.0.1:8776/v1/$(tenant_id)s | | region | RegionOne | | service_id | f098586f23374812b8907e4f166507ea | +-------------+----------------------------------------+ # glance 用エンドポイント作成 [root@dlp ~]# keystone endpoint-create --region RegionOne \ --service_id=a8431d1527354b5a8c1a97b13468f937 \ --publicurl="http://$my_host:9292/v1" \ --internalurl="http://$my_host:9292/v1" \ --adminurl="http://$my_host:9292/v1" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://127.0.0.1:9292/v1 | | id | 5b21c4efee0a443fbaddf85cf2367e7e | | internalurl | http://127.0.0.1:9292/v1 | | publicurl | http://127.0.0.1:9292/v1 | | region | RegionOne | | service_id | a8431d1527354b5a8c1a97b13468f937 | +-------------+----------------------------------+ # nova 用エンドポイント作成 [root@dlp ~]# keystone endpoint-create --region RegionOne \ --service_id=34e0bd084ae349dfae3f5ede135dea02 \ --publicurl="http://$my_host:\$(compute_port)s/v1.1/\$(tenant_id)s" \ --internalurl="http://$my_host:\$(compute_port)s/v1.1/\$(tenant_id)s" \ --adminurl="http://$my_host:\$(compute_port)s/v1.1/\$(tenant_id)s" +-------------+------------------------------------------------------+ | Property | Value | +-------------+------------------------------------------------------+ | adminurl | http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s | | id | 2a280b289c564b2d8131645171226a2c | | internalurl | http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s | | publicurl | http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s | | region | RegionOne | | service_id | 34e0bd084ae349dfae3f5ede135dea02 | +-------------+------------------------------------------------------+ # 設定確認 [root@dlp ~]# keystone endpoint-list +----------------------------------+-----------+------------------------------------------------------+ | id | region | publicurl | +----------------------------------+-----------+------------------------------------------------------+ | 2a280b289c564b2d8131645171226a2c | RegionOne | http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s | | 5b21c4efee0a443fbaddf85cf2367e7e | RegionOne | http://127.0.0.1:9292/v1 | | 708244ae6f2742bb9701d696581c8db2 | RegionOne | http://127.0.0.1:8776/v1/$(tenant_id)s | | babc2a40289c4a0898bfbbb18960145d | RegionOne | http://127.0.0.1:$(public_port)s/v2.0 | +----------------------------------+-----------+------------------------------------------------------+ +------------------------------------------------------+------------------------------------------------------+ | internalurl | adminurl | +------------------------------------------------------+------------------------------------------------------+ | http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s | http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s | | http://127.0.0.1:9292/v1 | http://127.0.0.1:9292/v1 | | http://127.0.0.1:8776/v1/$(tenant_id)s | http://127.0.0.1:8776/v1/$(tenant_id)s | | http://127.0.0.1:$(public_port)s/v2.0 | http://127.0.0.1:$(admin_port)s/v2.0 | +------------------------------------------------------+------------------------------------------------------+ +----------------------------------+ | service_id | +----------------------------------+ | 34e0bd084ae349dfae3f5ede135dea02 | | a8431d1527354b5a8c1a97b13468f937 | | f098586f23374812b8907e4f166507ea | | 24aa6eb74a3644888d36944a9e4a24b2 | +----------------------------------+ |
Sponsored Link |