インストールと設定

インストールと設定

このセクションでは、コントローラーノードに Orchestration サービス (コード名 heat) をインストールおよび設定する方法を説明します。

前提条件

Orchestration をインストールして設定する前に、データベース、サービスクレデンシャル、API エンドポイントを作成する必要があります。Orchestration では、スタックを管理するために Identity サービスに追加の情報も必要です。

  1. データベースを作成するには、これらの手順をすべて実行します。

    • データベースクライアントを使用して、データベースサーバーに root ユーザーとして接続します。

      $ mysql -u root -p
      
    • heat データベースを作成します。

      CREATE DATABASE heat;
      
    • heat データベースに適切なアクセス権を付与します。

      GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' \
        IDENTIFIED BY 'HEAT_DBPASS';
      GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' \
        IDENTIFIED BY 'HEAT_DBPASS';
      

      HEAT_DBPASS を適切なパスワードに置き換えます。

    • データベースクライアントを終了します。

  2. admin クレデンシャルを読み込み、管理者専用 CLI コマンドへのアクセス権を取得します。

    $ source admin-openrc.sh
    
  3. 以下の手順を実行して、サービスクレデンシャルを作成します。

    • heat ユーザーを作成します。

      $ openstack user create --domain default --password-prompt heat
      User Password:
      Repeat User Password:
      +-----------+----------------------------------+
      | Field     | Value                            |
      +-----------+----------------------------------+
      | domain_id | default                          |
      | enabled   | True                             |
      | id        | ca2e175b851943349be29a328cc5e360 |
      | name      | heat                             |
      +-----------+----------------------------------+
      
    • admin ロールを heat ユーザーに追加します。

      $ openstack role add --project service --user heat admin
      

      注釈

      このコマンドは何も出力しません。

    • heat および heat-cfn サービスエンティティーを作成します。

      $ openstack service create --name heat \
        --description "Orchestration" orchestration
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | Orchestration                    |
      | enabled     | True                             |
      | id          | 727841c6f5df4773baa4e8a5ae7d72eb |
      | name        | heat                             |
      | type        | orchestration                    |
      +-------------+----------------------------------+
      
      $ openstack service create --name heat-cfn \
        --description "Orchestration"  cloudformation
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | Orchestration                    |
      | enabled     | True                             |
      | id          | c42cede91a4e47c3b10c8aedc8d890c6 |
      | name        | heat-cfn                         |
      | type        | cloudformation                   |
      +-------------+----------------------------------+
      
  4. Orchestration サービス API エンドポイントを作成します。

    $ openstack endpoint create --region RegionOne \
      orchestration public http://controller:8004/v1/%\(tenant_id\)s
    +--------------+-----------------------------------------+
    | Field        | Value                                   |
    +--------------+-----------------------------------------+
    | enabled      | True                                    |
    | id           | 3f4dab34624e4be7b000265f25049609        |
    | interface    | public                                  |
    | region       | RegionOne                               |
    | region_id    | RegionOne                               |
    | service_id   | 727841c6f5df4773baa4e8a5ae7d72eb        |
    | service_name | heat                                    |
    | service_type | orchestration                           |
    | url          | http://controller:8004/v1/%(tenant_id)s |
    +--------------+-----------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      orchestration internal http://controller:8004/v1/%\(tenant_id\)s
    +--------------+-----------------------------------------+
    | Field        | Value                                   |
    +--------------+-----------------------------------------+
    | enabled      | True                                    |
    | id           | 9489f78e958e45cc85570fec7e836d98        |
    | interface    | internal                                |
    | region       | RegionOne                               |
    | region_id    | RegionOne                               |
    | service_id   | 727841c6f5df4773baa4e8a5ae7d72eb        |
    | service_name | heat                                    |
    | service_type | orchestration                           |
    | url          | http://controller:8004/v1/%(tenant_id)s |
    +--------------+-----------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      orchestration admin http://controller:8004/v1/%\(tenant_id\)s
    +--------------+-----------------------------------------+
    | Field        | Value                                   |
    +--------------+-----------------------------------------+
    | enabled      | True                                    |
    | id           | 76091559514b40c6b7b38dde790efe99        |
    | interface    | admin                                   |
    | region       | RegionOne                               |
    | region_id    | RegionOne                               |
    | service_id   | 727841c6f5df4773baa4e8a5ae7d72eb        |
    | service_name | heat                                    |
    | service_type | orchestration                           |
    | url          | http://controller:8004/v1/%(tenant_id)s |
    +--------------+-----------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      cloudformation public http://controller:8000/v1
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | b3ea082e019c4024842bf0a80555052c |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | c42cede91a4e47c3b10c8aedc8d890c6 |
    | service_name | heat-cfn                         |
    | service_type | cloudformation                   |
    | url          | http://controller:8000/v1        |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      cloudformation internal http://controller:8000/v1
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 169df4368cdc435b8b115a9cb084044e |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | c42cede91a4e47c3b10c8aedc8d890c6 |
    | service_name | heat-cfn                         |
    | service_type | cloudformation                   |
    | url          | http://controller:8000/v1        |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      cloudformation admin http://controller:8000/v1
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 3d3edcd61eb343c1bbd629aa041ff88b |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | c42cede91a4e47c3b10c8aedc8d890c6 |
    | service_name | heat-cfn                         |
    | service_type | cloudformation                   |
    | url          | http://controller:8000/v1        |
    +--------------+----------------------------------+
    
  5. Orchestration は、スタックを管理するために Identity サービスに追加の情報を必要とします。以下の手順をすべて実行して、この情報を追加してください。

    • heat ドメインを作成します。このドメインに、スタック用のプロジェクトとユーザーを収容します。

      $ openstack domain create --description "Stack projects and users" heat
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | Stack projects and users         |
      | enabled     | True                             |
      | id          | 0f4d1bd326f2454dacc72157ba328a47 |
      | name        | heat                             |
      +-------------+----------------------------------+
      
    • heat_domain_admin ユーザーを作成します。このユーザーは heat ドメインのプロジェクトとユーザーの管理を行います。

      $ openstack user create --domain heat --password-prompt heat_domain_admin
      User Password:
      Repeat User Password:
      +-----------+----------------------------------+
      | Field     | Value                            |
      +-----------+----------------------------------+
      | domain_id | 0f4d1bd326f2454dacc72157ba328a47 |
      | enabled   | True                             |
      | id        | b7bd1abfbcf64478b47a0f13cd4d970a |
      | name      | heat_domain_admin                |
      +-----------+----------------------------------+
      
    • admin ロールを heat ドメインの heat_domain_admin ユーザーに追加し、 heat_domain_admin ユーザーがスタック管理の管理者特権を持つようにします。

      $ openstack role add --domain heat --user heat_domain_admin admin
      

      注釈

      このコマンドは何も出力しません。

    • heat_stack_owner ロールを作成します。

      $ openstack role create heat_stack_owner
      +-------+----------------------------------+
      | Field | Value                            |
      +-------+----------------------------------+
      | id    | 15e34f0c4fed4e68b3246275883c8630 |
      | name  | heat_stack_owner                 |
      +-------+----------------------------------+
      
    • heat_stack_owner ロールを demo プロジェクトと demo ユーザーに追加し、 demo ユーザーがスタックの管理を行えるようにします。

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

      注釈

      このコマンドは何も出力しません。

      注釈

      スタックの管理を行う各ユーザーに heat_stack_owner ロールを追加する必要があります。

    • heat_stack_user ロールを作成します。

      $ openstack role create heat_stack_user
      +-------+----------------------------------+
      | Field | Value                            |
      +-------+----------------------------------+
      | id    | 88849d41a55d4d1d91e4f11bffd8fc5c |
      | name  | heat_stack_user                  |
      +-------+----------------------------------+
      

      注釈

      Orchestration サービスは、スタックの展開中に作成されるユーザーに、自動的に heat_stack_user ロールを割り当てます。このロールはデフォルトで API 操作を制限します。競合を避けるために、このロールを heat_stack_owner ロールを持つユーザーに追加しないでください。

コンポーネントのインストールと設定

注釈

設定ファイルのデフォルトは、ディストリビューションにより異なります。これらの既存のセクションとオプションを編集するのではなく、追加する必要があるかもしれません。また、設定のスニペットにある 省略 (...) は、保持すべきデフォルトの設定オプションを意味します。

  1. パッケージをインストールします。

    # yum install openstack-heat-api openstack-heat-api-cfn \
      openstack-heat-engine python-heatclient
    
  1. /etc/heat/heat.conf ファイルを編集し、以下の作業をすべて行います。

    • [database] セクションで、データベースのアクセス方法を設定します。

      [database]
      ...
      connection = mysql://heat:HEAT_DBPASS@controller/heat
      

      HEAT_DBPASS を Orchestration データベース用に選択したパスワードに置き換えます。

    • [DEFAULT][oslo_messaging_rabbit] セクションに、RabbitMQ メッセージキューのアクセス方法を設定します。

      [DEFAULT]
      ...
      rpc_backend = rabbit
      
      [oslo_messaging_rabbit]
      ...
      rabbit_host = controller
      rabbit_userid = openstack
      rabbit_password = RABBIT_PASS
      

      RABBIT_PASSRabbitMQopenstack アカウント用に選択したパスワードで置き換えます。

    • セクション [keystone_authtoken], trustee], [clients_keystone], [ec2authtoken] に、Identity サービスへのアクセス方法を設定します。

      [keystone_authtoken]
      ...
      auth_uri = http://controller:5000
      auth_url = http://controller:35357
      auth_plugin = password
      project_domain_id = default
      user_domain_id = default
      project_name = service
      username = heat
      password = HEAT_PASS
      
      [trustee]
      ...
      auth_plugin = password
      auth_url = http://controller:35357
      username = heat
      password = HEAT_PASS
      user_domain_id = default
      
      [clients_keystone]
      ...
      auth_uri = http://controller:5000
      
      [ec2authtoken]
      ...
      auth_uri = http://controller:5000/v3
      

      HEAT_PASS を、 Identity サービスにおいて heat ユーザー用に選択したパスワードで置き換えます。

    • [DEFAULT] セクションで、メタデータの URL と待機条件の URL を設定します。

      [DEFAULT]
      ...
      heat_metadata_server_url = http://controller:8000
      heat_waitcondition_server_url = http://controller:8000/v1/waitcondition
      
    • [DEFAULT] セクションに、 スタックドメインと管理者クレデンシャルを設定します。

      [DEFAULT]
      ...
      stack_domain_admin = heat_domain_admin
      stack_domain_admin_password = HEAT_DOMAIN_PASS
      stack_user_domain_name = heat
      

      HEAT_DOMAIN_PASS は Identity サービスで heat_domain_admin ユーザー用に選択したパスワードに置き換えます。

    • (オプション) トラブルシューティングしやすくするために、冗長ロギングを [DEFAULT] セクションで有効にします。

      [DEFAULT]
      ...
      verbose = True
      
  2. Orchestration データベースを展開します。

    # su -s /bin/sh -c "heat-manage db_sync" heat
    

インストールの最終作業

  • Orchestration サービスを起動し、システム起動時に起動するよう設定します。

    # systemctl enable openstack-heat-api.service \
      openstack-heat-api-cfn.service openstack-heat-engine.service
    # systemctl start openstack-heat-api.service \
      openstack-heat-api-cfn.service openstack-heat-engine.service
    
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.