[root@controller2 ~]#openstack role create admin +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | None | | id | 8e3790e764544b19ad89852948c9e077 | | name | admin | +-----------+----------------------------------+ [root@controller2 ~]#openstack role list +----------------------------------+-------+ | ID | Name | +----------------------------------+-------+ | 8e3790e764544b19ad89852948c9e077 | admin | +----------------------------------+-------+
[root@controller2 ~]#openstack user create --domain default --password-prompt demo User Password: demo Repeat User Password:demo +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | f9a9c4f4cd2647e8a5d6fe012ec07788 | | enabled | True | | id | 1b4610763476402c9195650b54b9b551 | | name | demo | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
创建一个 user 角色:
角色目前有 user 和 admin:
1 2 3 4 5 6 7 8
[root@controller2 ~]#openstack role create user +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | None | | id | 1d5ed3e1be4f4f15acc67d1040cccc55 | | name | user | +-----------+----------------------------------+
把 demo 用户添加到 demo 项目:然后赋予 user 权限:
1
[root@controller2 ~]#openstack role add --project demo --user demo user
创建一个 service 项目:
各服务之间与 keystone 进行访问和认证,service 用于给服务创建用户
创建 service 项目:
1 2 3 4 5 6 7 8 9 10 11 12
[root@controller2 ~]#openstack project create --domain default --description "Service Project" service +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | Service Project | | domain_id | f9a9c4f4cd2647e8a5d6fe012ec07788 | | enabled | True | | id | cac1d2794af34a9990ea8ede036e1250 | | is_domain | False | | name | service | | parent_id | f9a9c4f4cd2647e8a5d6fe012ec07788 | +-------------+----------------------------------+
创建 glance 用户并设置密码为 glance
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@controller2 ~]#openstack user create --domain default --password-prompt glance User Password: Repeat User Password: +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | f9a9c4f4cd2647e8a5d6fe012ec07788 | | enabled | True | | id | b44be253b32c4c01b9d6529e01391be0 | | name | glance | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
[root@controller2 ~]#openstack role add --project service --user glance admin
按照以上 步骤操作 a nova 和 neutron 用户:
将 nova 用户添加到 service 项目并授予 admin 权限
创建 nova 用户并设置 密码为 为 nova
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@controller2 ~]#openstack user create --domain default --password-prompt nova User Password: Repeat User Password: +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | f9a9c4f4cd2647e8a5d6fe012ec07788 | | enabled | True | | id | 7be49e0adbd24743836b022f99d7b4f3 | | name | nova | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
创建 neutron 用户并 设置 密码为 neutron :
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@controller2 ~]#openstack user create --domain default --password-prompt neutron User Password: Repeat User Password: +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | f9a9c4f4cd2647e8a5d6fe012ec07788 | | enabled | True | | id | 55cd53a5f8cd4027a677074aa299e85f | | name | neutron | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
将 nova 和 neutron 用户授权为 service 项目的 admi 权限
1 2
[root@controller2 ~]#openstack role add --project service --user nova admin [root@controller2 ~]#openstack role add --project service --user neutron admin