Ubuntu 16.04
Sponsored Link

OpenStack Newton : Heat 設定#12016/12/22

 
OpenStack Orchestration Service(Heat)をインストールします。
ここでは以下のような構築済みの環境に Heat を追加インストールして設定します。
例として、Network Node に Orchestration サービス一式をインストールして設定します。
                                |
+------------------+            |            +------------------------+
| [ Control Node ] |            |            |    [ Network Node ]    |
|     Keystone     |10.0.0.30   |   10.0.0.50|    DHCP,L3,L2 Agent    |
|      Glance      |------------+------------|     Metadata Agent     |
|     Nova API     |eth0        |        eth0|    Heat API,API-CFN    |
|  Neutron Server  |            |            |       Heat Engine      |
+------------------+            |            +------------------------+
                            eth0|10.0.0.51
                      +--------------------+
                      |  [ Compute Node ]  |
                      |    Nova Compute    |
                      |      L2 Agent      |
                      +--------------------+

 
Heat の設定前に必要なユーザーやデータベースを Control Node に登録しておきます。
[1] 必要なパッケージをインストールしておきます。
root@dlp ~(keystone)#
apt-get -y install heat-common
[2] Control ノードの Keystone に Heat 用のユーザー等々を登録しておきます。
# heat ユーザー作成 (service プロジェクト所属)

root@dlp ~(keystone)#
openstack user create --domain default --project service --password servicepassword heat

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | e2fed44089aa40dc88f5ae6ed9dfe915 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 872936603cfb4bb8bab64f2662ba4e92 |
| name                | heat                             |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# heat ユーザーを adminロール に加える

root@dlp ~(keystone)#
openstack role add --project service --user heat admin
# heat 用ロール作成

root@dlp ~(keystone)#
openstack role create heat_stack_owner

+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | 7946da4067e342aa9ef3f090fb6351f1 |
| name      | heat_stack_owner                 |
+-----------+----------------------------------+

root@dlp ~(keystone)#
openstack role create heat_stack_user

+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | 828bc9fe8865439da806566eb0195e95 |
| name      | heat_stack_user                  |
+-----------+----------------------------------+

# admin ユーザーを heat_stack_owner ロール に加える

root@dlp ~(keystone)#
openstack role add --project admin --user admin heat_stack_owner
# heat 用サービスエントリ作成

root@dlp ~(keystone)#
openstack service create --name heat --description "Openstack Orchestration" orchestration

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Openstack Orchestration          |
| enabled     | True                             |
| id          | b2b9dd57d11a43a6bdda7acefc3270d3 |
| name        | heat                             |
| type        | orchestration                    |
+-------------+----------------------------------+

root@dlp ~(keystone)#
openstack service create --name heat-cfn --description "Openstack Orchestration" cloudformation

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Openstack Orchestration          |
| enabled     | True                             |
| id          | 00fa05c44c42447f8a3f1236fe1874fd |
| name        | heat-cfn                         |
| type        | cloudformation                   |
+-------------+----------------------------------+

# Heat API サーバーの IPアドレスを定義

root@dlp ~(keystone)#
heat_api=10.0.0.50
# orchestration 用エンドポイント作成 (public)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne orchestration public http://$heat_api:8004/v1/%\(tenant_id\)s

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| enabled      | True                                   |
| id           | 6b6588b751b446f999859d327093fb84       |
| interface    | public                                 |
| region       | RegionOne                              |
| region_id    | RegionOne                              |
| service_id   | b2b9dd57d11a43a6bdda7acefc3270d3       |
| service_name | heat                                   |
| service_type | orchestration                          |
| url          | http://10.0.0.50:8004/v1/%(tenant_id)s |
+--------------+----------------------------------------+

# orchestration 用エンドポイント作成 (internal)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne orchestration internal http://$heat_api:8004/v1/%\(tenant_id\)s

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| enabled      | True                                   |
| id           | 7ea7de77ccdc4953871f9c0d39b7392d       |
| interface    | internal                               |
| region       | RegionOne                              |
| region_id    | RegionOne                              |
| service_id   | b2b9dd57d11a43a6bdda7acefc3270d3       |
| service_name | heat                                   |
| service_type | orchestration                          |
| url          | http://10.0.0.50:8004/v1/%(tenant_id)s |
+--------------+----------------------------------------+

# orchestration 用エンドポイント作成 (admin)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne orchestration admin http://$heat_api:8004/v1/%\(tenant_id\)s

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| enabled      | True                                   |
| id           | 555c63bb3a544d7b9e3b5524b517a83b       |
| interface    | admin                                  |
| region       | RegionOne                              |
| region_id    | RegionOne                              |
| service_id   | b2b9dd57d11a43a6bdda7acefc3270d3       |
| service_name | heat                                   |
| service_type | orchestration                          |
| url          | http://10.0.0.50:8004/v1/%(tenant_id)s |
+--------------+----------------------------------------+

# cloudformation 用エンドポイント作成 (public)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne cloudformation public http://$heat_api:8000/v1

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | d4fa06db642a44ad80060fd77c5bf6b4 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 00fa05c44c42447f8a3f1236fe1874fd |
| service_name | heat-cfn                         |
| service_type | cloudformation                   |
| url          | http://10.0.0.50:8000/v1         |
+--------------+----------------------------------+

# cloudformation 用エンドポイント作成 (internal)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne cloudformation internal http://$heat_api:8000/v1

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 3f374e16f2bd470db9ff3045bde1fed7 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 00fa05c44c42447f8a3f1236fe1874fd |
| service_name | heat-cfn                         |
| service_type | cloudformation                   |
| url          | http://10.0.0.50:8000/v1         |
+--------------+----------------------------------+

# cloudformation 用エンドポイント作成 (admin)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne cloudformation admin http://$heat_api:8000/v1

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 2a4b397fa1b2418d8943d09664309091 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 00fa05c44c42447f8a3f1236fe1874fd |
| service_name | heat-cfn                         |
| service_type | cloudformation                   |
| url          | http://10.0.0.50:8000/v1         |
+--------------+----------------------------------+

# Heat ドメイン作成

root@dlp ~(keystone)#
openstack domain create --description "Stack projects and users" heat

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Stack projects and users         |
| enabled     | True                             |
| id          | b363a1e1d56d4b2387c9b00f27d29ae2 |
| name        | heat                             |
+-------------+----------------------------------+

# heat_domain_admin ユーザー作成

root@dlp ~(keystone)#
openstack user create --domain heat --password servicepassword heat_domain_admin

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | b363a1e1d56d4b2387c9b00f27d29ae2 |
| enabled             | True                             |
| id                  | a40065da56d3448db4a3dc233110fb47 |
| name                | heat_domain_admin                |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# heat_domain_admin ユーザーを adminロール に加える

root@dlp ~(keystone)#
openstack role add --domain heat --user heat_domain_admin admin
[3] Heat 用のユーザーとデータベースを MariaDB に登録しておきます。
root@dlp ~(keystone)#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 75
Server version: 10.0.27-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database heat;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on heat.* to heat@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on heat.* to heat@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
関連コンテンツ