6.3. Block Storage Prerequisite Configuration
6.3.1. Create the Block Storage Database
In this procedure the database and database user that will be used by the Block Storage services will be created. These steps must be performed while logged in to the database server as the
root user.
Procedure 6.1. Creating the database to be used by Block Storage Services
- Connect to the database service using the
mysqlcommand.#mysql -u root -p - Create the
cinderdatabase.mysql>CREATE DATABASE cinder; - Create a
cinderdatabase user and grant it access to thecinderdatabase.mysql>GRANT ALL ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'PASSWORD';mysql>GRANT ALL ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'PASSWORD';Replace PASSWORD with a secure password that will be used to authenticate with the database server as this user. - Flush the database privileges to ensure that they take effect immediately.
mysql>FLUSH PRIVILEGES; - Exit the
mysqlclient.mysql>quit
The block storage database has been created. The database will be populated during service configuration.
6.3.2. Create the Block Storage Service Identity Records
The steps outlined in this procedure cover the creation of Identity records to support the Block Storage service:
- Create the
cinderuser, who has theadminrole in theservicestenant. - Create the
cinderservice entry and assign it an endpoint.
These entries provide authentication for the Block Storage services, and guide other OpenStack services attempting to locate and access the volume functionality provided by Block Storage.
In order to proceed, you should have already performed the following (through the Identity service):
- Created an Administrator role named
admin(refer to Section 3.8, “Create an Administrator Account” for instructions) - Created the
servicestenant (refer to Section 3.10, “Create the Services Tenant” for instructions)
Note
The Deploying OpenStack: Learning Environments guide uses one tenant for all service users. For more information, refer to Section 3.10, “Create the Services Tenant”.
You can perform the following procedure from your Identity service host or on any machine where you've copied the
keystonerc_admin file (which contains administrator credentials) and the keystone command-line utility is installed.
Procedure 6.2. Creating Identity records for the Block Storage service
- Authenticate as the administrator of the Identity service by running the
sourcecommand on thekeystonerc_adminfile containing the required credentials.#source ~/keystonerc_admin - Create a user named
cinderfor the Block Storage service to use.#keystone user-create --name cinder --pass PASSWORD+----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | e1765f70da1b4432b54ced060139b46a | | name | cinder | | tenantId | | +----------+----------------------------------+Replace PASSWORD with a secure password that will be used by the Block Storage service when authenticating with the Identity service. - Use the
keystone user-role-addcommand to link thecinderuser,adminrole, andservicestenant together:#keystone user-role-add --user cinder --role admin --tenant services - Create the
cinderservice entry:#keystone service-create --name cinder \--type volume \--description "Cinder Volume Service"+-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Cinder Volume Service | | id | dfde7878671e484c9e581a3eb9b63e66 | | name | cinder | | type | volume | +-------------+----------------------------------+ - Create the
cinderendpoint entry.#keystone endpoint-create \--service cinder \--publicurl "http://IP:8776/v1/\$(tenant_id)s" \--adminurl "http://IP:8776/v1/\$(tenant_id)s" \--internalurl "http://IP:8776/v1/\$(tenant_id)s"Replace IP with the IP address or host name of the system that will be hosting the Block Storage service API (openstack-cinder-api).Important
If you intend to install and run multiple instances of the API service then you must repeat this step for the IP address or host name of each instance.
All supporting Identity service entries required by the Block Storage services have been created.