next up previous contents
Next: 控制節點安裝與設定 Up: Nova Previous: 安裝前資料庫準備   Contents

安裝前環境準備

  1. 先讀取 openstack 管理者 admin 環境變數。
    [root@ip112 ~]# source admin.token
    
  2. 新增 nova 用戶,輸入密碼後產生。
    [root@ip112 ~]# openstack user create --domain default --password-prompt nova
    User Password:
    Repeat User Password:
    +---------------------+----------------------------------+
    | Field               | Value                            |
    +---------------------+----------------------------------+
    | domain_id           | default                          |
    | enabled             | True                             |
    | id                  | 97aea43e81b047b39a58af7c4d4d1b1e |
    | name                | nova                             |
    | options             | {}                               |
    | password_expires_at | None                             |
    +---------------------+----------------------------------+
    
  3. 新增 admin role 到 nova user 及 service project。
    [root@ip112 ~]# openstack role add --project service --user nova admin
    
  4. 新增 nova service。
    [root@ip112 ~]# openstack service create --name nova \
    --description "OpenStack Compute" compute
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | OpenStack Compute                |
    | enabled     | True                             |
    | id          | ca566f55091a40d9b1965300e6e1a13c |
    | name        | nova                             |
    | type        | compute                          |
    +-------------+----------------------------------+
    
  5. 新增 Compute API service endpoints,interface public。
    [root@ip112 ~]# openstack endpoint create --region RegionOne \
    compute public http://controller:8774/v2.1
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | f66129d889db4659aa9ae8731b7be7b9 |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | ca566f55091a40d9b1965300e6e1a13c |
    | service_name | nova                             |
    | service_type | compute                          |
    | url          | http://controller:8774/v2.1      |
    +--------------+----------------------------------+
    
  6. 新增 Compute API service endpoints,interface internal。
    [root@ip112 ~]# openstack endpoint create --region RegionOne \
    compute internal http://controller:8774/v2.1
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | e2266bff21074f048984473845ffd761 |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | ca566f55091a40d9b1965300e6e1a13c |
    | service_name | nova                             |
    | service_type | compute                          |
    | url          | http://controller:8774/v2.1      |
    +--------------+----------------------------------+
    
  7. 新增 Compute API service endpoints,interface admin。
    [root@ip112 ~]# openstack endpoint create --region RegionOne \
    compute admin http://controller:8774/v2.1
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 3745bbc0c5084665b17b567256b7d53c |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | ca566f55091a40d9b1965300e6e1a13c |
    | service_name | nova                             |
    | service_type | compute                          |
    | url          | http://controller:8774/v2.1      |
    +--------------+----------------------------------+
    
  8. 新增 Placement service 用戶,輸入密碼 123qwe 後產生。
    [root@ip112 ~]# openstack user create --domain default --password-prompt placement
    User Password:
    Repeat User Password:
    +---------------------+----------------------------------+
    | Field               | Value                            |
    +---------------------+----------------------------------+
    | domain_id           | default                          |
    | enabled             | True                             |
    | id                  | 3c5acc18f314451eafd55a51ed595e62 |
    | name                | placement                        |
    | options             | {}                               |
    | password_expires_at | None                             |
    +---------------------+----------------------------------+
    
  9. 新增 admin role 到 placement user 及 service project。
    [root@ip112 ~]# openstack role add --project service --user placement admin
    
  10. 新增 Placement API entry。
    [root@ip112 ~]# openstack service create --name placement --description "Placement API" placement
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Placement API                    |
    | enabled     | True                             |
    | id          | b28b45e816a74c3a89f91dd620fea022 |
    | name        | placement                        |
    | type        | placement                        |
    +-------------+----------------------------------+
    
  11. 新增 Placement API service endpoints,interface public。
    [root@ip112 ~]# openstack endpoint create --region RegionOne placement public http://controller:8778
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 033e4a2cfe554791be117b6e907f1328 |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | b28b45e816a74c3a89f91dd620fea022 |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    
  12. 新增 Placement API service endpoints,interface internal。
    [root@ip112 ~]# openstack endpoint create --region RegionOne placement internal http://controller:8778
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | e7c2f2d7b4d5400094f6af4979c1c46b |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | b28b45e816a74c3a89f91dd620fea022 |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    
  13. 新增 Placement API service endpoints,interface admin。
    [root@ip112 ~]# openstack endpoint create --region RegionOne placement admin http://controller:8778
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 80829b253d9c4eacb80616775f0c989d |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | b28b45e816a74c3a89f91dd620fea022 |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    



De-Yu Wang 2018-12-12