创建域、项目、用户和角色

创建域、项目、用户和角色

The Identity service provides authentication services for each OpenStack service. The authentication service uses a combination of domains, projects, users, and roles.

  1. 本指南使用一个你添加到你的环境中每个服务包含独有用户的service 项目。创建``service``项目:

    $ openstack project create --domain default \
      --description "Service Project" service
    
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Service Project                  |
    | domain_id   | default                          |
    | enabled     | True                             |
    | id          | 24ac7f19cd944f4cba1d77469b2a73ed |
    | is_domain   | False                            |
    | name        | service                          |
    | parent_id   | default                          |
    +-------------+----------------------------------+
    
  2. 常规(非管理)任务应该使用无特权的项目和用户。作为例子,本指南创建 demo 项目和用户。

    • 创建``demo`` 项目:

      $ openstack project create --domain default \
        --description "Demo Project" demo
      
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | Demo Project                     |
      | domain_id   | default                          |
      | enabled     | True                             |
      | id          | 231ad6e7ebba47d6a1e57e1cc07ae446 |
      | is_domain   | False                            |
      | name        | demo                             |
      | parent_id   | default                          |
      +-------------+----------------------------------+
      

      注解

      当为这个项目创建额外用户时,不要重复这一步。

    • 创建``demo`` 用户:

      $ openstack user create --domain default \
        --password-prompt demo
      
      User Password:
      Repeat User Password:
      +---------------------+----------------------------------+
      | Field               | Value                            |
      +---------------------+----------------------------------+
      | domain_id           | default                          |
      | enabled             | True                             |
      | id                  | aeda23aa78f44e859900e22c24817832 |
      | name                | demo                             |
      | options             | {}                               |
      | password_expires_at | None                             |
      +---------------------+----------------------------------+
      
    • 创建 user 角色:

      $ openstack role create user
      
      +-----------+----------------------------------+
      | Field     | Value                            |
      +-----------+----------------------------------+
      | domain_id | None                             |
      | id        | 997ce8d05fc143ac97d83fdfb5998552 |
      | name      | user                             |
      +-----------+----------------------------------+
      
    • Add the user role to the demo user of the demo project:

      $ openstack role add --project demo --user demo user
      

      注解

      这个命令执行后没有输出。

注解

你可以重复此过程来创建额外的项目和用户。

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.