.. _install-ubuntu:

Install and configure for Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section describes how to install and configure the Orchestration service
for Ubuntu 14.04 (LTS).

Prerequisites
-------------

Before you install and configure Orchestration, you must create a
database, service credentials, and API endpoints. Orchestration also
requires additional information in the Identity service.

#. To create the database, complete these steps:

   * Use the database access client to connect to the database
     server as the ``root`` user:

     .. code-block:: console

        $ mysql -u root -p

   * Create the ``heat`` database:

     .. code-block:: console

        CREATE DATABASE heat;

   * Grant proper access to the ``heat`` database:

     .. code-block:: console

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

     Replace ``HEAT_DBPASS`` with a suitable password.

   * Exit the database access client.

#. Source the ``admin`` credentials to gain access to
   admin-only CLI commands:

   .. code-block:: console

      $ . admin-openrc

#. To create the service credentials, complete these steps:

   * Create the ``heat`` user:

     .. code-block:: console

        $ openstack user create --domain default --password-prompt heat
        User Password:
        Repeat User Password:
        +-----------+----------------------------------+
        | Field     | Value                            |
        +-----------+----------------------------------+
        | domain_id | e0353a670a9e496da891347c589539e9 |
        | enabled   | True                             |
        | id        | ca2e175b851943349be29a328cc5e360 |
        | name      | heat                             |
        +-----------+----------------------------------+

   * Add the ``admin`` role to the ``heat`` user:

     .. code-block:: console

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

     .. note::

        This command provides no output.

   * Create the ``heat`` and ``heat-cfn`` service entities:

     .. code-block:: console

        $ 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                   |
        +-------------+----------------------------------+

#. Create the Orchestration service API endpoints:

   .. code-block:: console

      $ 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 |
      +--------------+-----------------------------------------+

   .. code-block:: console

      $ 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        |
      +--------------+----------------------------------+

#. Orchestration requires additional information in the Identity service to
   manage stacks. To add this information, complete these steps:

   * Create the ``heat`` domain that contains projects and users
     for stacks:

     .. code-block:: console

        $ openstack domain create --description "Stack projects and users" heat
        +-------------+----------------------------------+
        | Field       | Value                            |
        +-------------+----------------------------------+
        | description | Stack projects and users         |
        | enabled     | True                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        