Install and configure Placement for Red Hat Enterprise Linux and CentOS

This section describes how to install and configure the placement service when using Red Hat Enterprise Linux or CentOS packages.

Prerequisites

Before you install and configure the placement service, you must create a database, service credentials, and API endpoints.

Create Database

  1. To create the database, complete these steps:

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

      $ mysql -u root -p
      
    • Create the placement database:

      MariaDB [(none)]> CREATE DATABASE placement;
      
    • Grant proper access to the database:

      MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' \
        IDENTIFIED BY 'PLACEMENT_DBPASS';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' \
        IDENTIFIED BY 'PLACEMENT_DBPASS';
      

      Replace PLACEMENT_DBPASS with a suitable password.

    • Exit the database access client.

Configure User and Endpoints

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

    $ . admin-openrc
    
  2. Create a Placement service user using your chosen PLACEMENT_PASS:

    $ openstack user create --domain default --password-prompt placement
    
    User Password:
    Repeat User Password:
    +---------------------+----------------------------------+
    | Field               | Value                            |
    +---------------------+----------------------------------+
    | domain_id           | default                          |
    | enabled             | True                             |
    | id                  | fa742015a6494a949f67629884fc7ec8 |
    | name                | placement                        |
    | options             | {}                               |
    | password_expires_at | None                             |
    +---------------------+----------------------------------+
    
  3. Add the Placement user to the service project with the admin role:

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

    Note

    This command provides no output.

  4. Create the Placement API entry in the service catalog:

    $ openstack service create --name placement \
      --description "Placement API" placement
    
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Placement API                    |
    | enabled     | True                             |
    | id          | 2d1a27022e6e4185b86adac4444c495f |
    | name        | placement                        |
    | type        | placement                        |
    +-------------+----------------------------------+
    
  5. Create the Placement API service endpoints:

    Note

    Depending on your environment, the URL for the endpoint will vary by port (possibly 8780 instead of 8778, or no port at all) and hostname. You are responsible for determining the correct URL.

    $ openstack endpoint create --region RegionOne \
      placement public http://controller:8778
    
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 2b1b2637908b4137a9c2e0470487cbc0 |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 2d1a27022e6e4185b86adac4444c495f |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      placement internal http://controller:8778
    
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 02bcda9a150a4bd7993ff4879df971ab |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 2d1a27022e6e4185b86adac4444c495f |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      placement admin http://controller:8778
    
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 3d71177b9e0f406f98cbff198d74b182 |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 2d1a27022e6e4185b86adac4444c495f |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    

Install and configure components

Note

Default configuration files vary by distribution. You might need to add these sections and options rather than modifying existing sections and options. Also, an ellipsis (...) in the configuration snippets indicates potential default configuration options that you should retain.

  1. Install the packages:

    # yum install openstack-placement-api
    
  2. Edit the /etc/placement/placement.conf file and complete the following actions:

    • In the [placement_database] section, configure database access:

      [placement_database]
      # ...
      connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement
      

      Replace PLACEMENT_DBPASS with the password you chose for the placement database.

    • In the [api] and [keystone_authtoken] sections, configure Identity service access:

      [api]
      # ...
      auth_strategy = keystone
      
      [keystone_authtoken]
      # ...
      auth_url = http://controller:5000/v3
      memcached_servers = controller:11211
      auth_type = password
      project_domain_name = Default
      user_domain_name = Default
      project_name = service
      username = placement
      password = PLACEMENT_PASS
      

      Replace PLACEMENT_PASS with the password you chose for the placement user in the Identity service.

      Note

      Comment out or remove any other options in the [keystone_authtoken] section.

      Note

      The value of user_name, password, project_domain_name and user_domain_name need to be in sync with your keystone config.

  3. Populate the placement database:

    # su -s /bin/sh -c "placement-manage db sync" placement
    

    Note

    Ignore any deprecation messages in this output.

Finalize installation

  • Restart the httpd service:

    # systemctl restart httpd