metal/inventory/inventory/doc/source/install/common_prerequisites.rst

2.0 KiB

Prerequisites

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

  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 inventory database:

      CREATE DATABASE inventory;
    • Grant proper access to the inventory database:

      GRANT ALL PRIVILEGES ON inventory.* TO 'inventory'@'localhost' \
        IDENTIFIED BY 'INVENTORY_DBPASS';
      GRANT ALL PRIVILEGES ON inventory.* TO 'inventory'@'%' \
        IDENTIFIED BY 'INVENTORY_DBPASS';

      Replace INVENTORY_DBPASS with a suitable password.

    • Exit the database access client.

      exit;
  2. Source the admin credentials to gain access to admin-only CLI commands:

    $ . admin-openrc
  3. To create the service credentials, complete these steps:

    • Create the inventory user:

      $ openstack user create --domain default --password-prompt inventory
    • Add the admin role to the inventory user:

      $ openstack role add --project service --user inventory admin
    • Create the inventory service entities:

      $ openstack service create --name inventory --description "inventory" inventory
  4. Create the inventory service API endpoints:

    $ openstack endpoint create --region RegionOne \
      inventory public http://controller:XXXX/vY/%\(tenant_id\)s
    $ openstack endpoint create --region RegionOne \
      inventory internal http://controller:XXXX/vY/%\(tenant_id\)s
    $ openstack endpoint create --region RegionOne \
      inventory admin http://controller:XXXX/vY/%\(tenant_id\)s