Rate This Document
Findability
Accuracy
Completeness
Readability

Installing, Configuring, and Verifying Placement

Placement provides an HTTP API for tracking the resource provider inventories and usage.

  • Skip this section when deploying OpenStack Rocky. In the Rocky version, Placement is not an independent component but is integrated into the Nova component. For details about the configuration, see Installing, Configuring, and Verifying Nova.
  • Install, configure, and verify Placement on controller nodes.

Creating a Placement Database

  1. Access the MySQL database.
    1
    mysql -u root -p
    
  2. Create a database for Placement.
    1
    CREATE DATABASE placement;
    
  3. Grant a permission for the database, and <PASSWORD> indicates the password for accessing the database.
    1
    2
    GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY '<PASSWORD>';
    GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY '<PASSWORD>';
    
  4. Exit the database access client.

Configuring Users and Endpoints

  1. Log in to the OpenStack CLI as the admin user.
    1
    source /etc/keystone/admin-openrc
    
  2. Create the placement user and set a password.
    1
    openstack user create --domain default --password-prompt placement
    
  3. Add a role.
    1
    2
    openstack role add --project service --user placement admin
    openstack service create --name placement --description "Placement API" placement
    
  4. Create Placement API service endpoints.
    1
    2
    3
    openstack endpoint create --region RegionOne placement public http://controller:8778
    openstack endpoint create --region RegionOne placement internal http://controller:8778
    openstack endpoint create --region RegionOne placement admin http://controller:8778
    
  5. Install and configure components.
    1. Install the Placement installation package.
      1
      yum -y install openstack-placement-api
      
    2. Edit the /etc/placement/placement.conf file and make the following changes:
      1. In the [placement_database] section, configure the database access and set PASSWORD to the password for accessing the Placement database.
        1
        2
        [placement_database]
        connection = mysql+pymysql://placement:<PASSWORD>@controller/placement
        

      2. Configure Identity service access in [api] and [keystone_authtoken] sections.
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        [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 = <PASSWORD>
        

        Set PASSWORD to the password of the keystone user.

  6. Modify the /etc/httpd/conf.d/00-placement-api.conf file.
    1
    vim /etc/httpd/conf.d/00-placement-api.conf
    

    Add the following to the ErrorLog /var/log/placement/placement-api.log file:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    <Directory /usr/bin>
    <IfVersion >= 2.4>
    Require all granted
    </IfVersion>
    <IfVersion < 2.4>
    Order allow,deny
    Allow from all
    </IfVersion>
    </Directory>
    

Starting the Placement Service

  1. Populate the Placement database.
    1
    su -s /bin/sh -c "placement-manage db sync" placement
    

    Restart the httpd service.

    1
    systemctl restart httpd
    

Verifying Placement

  1. Log in to the OpenStack CLI as the admin user.
    1
    source /etc/keystone/admin-openrc
    
  2. Check the status to ensure normal operation.
    1
    placement-status upgrade check
    

  3. Install pip.
    1
    2
    3
    yum install -y epel-release
    yum install -y python-pip
    sed -i "s/enabled=1/enabled=0/g" epe*.repo
    
  4. Run the following commands for the Placement API:
    1. Install the osc-placement plugin.
      1
      pip install osc-placement
      
    2. List available resource classes and features.
      1
      2
      openstack --os-placement-api-version 1.2 resource class list --sort-column name
      openstack --os-placement-api-version 1.6 trait list --sort-column name