Install and configure controller nodeThis section describes how to install and configure the Block
Storage service, code-named cinder, on the controller node. This
service requires at least one additional storage node that provides
volumes to instances.To configure prerequisitesBefore you install and configure the Block Storage service, you
must create a database, service credentials, and API endpoints.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 -pCreate the cinder database:CREATE DATABASE cinder;Grant proper access to the cinder
database:GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
IDENTIFIED BY 'CINDER_DBPASS';GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
IDENTIFIED BY 'CINDER_DBPASS';Replace CINDER_DBPASS with
a suitable password.Exit the database access client.Source the admin credentials to gain access to
admin-only CLI commands:$source admin-openrc.shTo create the service credentials, complete these steps:Create a cinder user:$keystone user-create --name cinder --pass CINDER_PASS+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | |
| enabled | True |
| id | 881ab2de4f7941e79504a759a83308be |
| name | cinder |
| username | cinder |
+----------+----------------------------------+Replace CINDER_PASS with a suitable
password.Add the admin role to the
cinder user:$keystone user-role-add --user cinder --tenant service --role adminThis command provides no output.Create the cinder service entities:$keystone service-create --name cinder --type volume \
--description "OpenStack Block Storage"+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | 1e494c3e22a24baaafcaf777d4d467eb |
| name | cinder |
| type | volume |
+-------------+----------------------------------+$keystone service-create --name cinderv2 --type volumev2 \
--description "OpenStack Block Storage"+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | 16e038e449c94b40868277f1d801edb5 |
| name | cinderv2 |
| type | volumev2 |
+-------------+----------------------------------+The Block Storage service requires two different service
entities to support API versions 1 and 2.Create the Block Storage service API endpoints:$keystone endpoint-create \
--service-id $(keystone service-list | awk '/ volume / {print $2}') \
--publicurl http://controller:8776/v1/%\(tenant_id\)s \
--internalurl http://controller:8776/v1/%\(tenant_id\)s \
--adminurl http://controller:8776/v1/%\(tenant_id\)s \
--region regionOne+-------------+-----------------------------------------+
| Property | Value |
+-------------+-----------------------------------------+
| adminurl | http://controller:8776/v1/%(tenant_id)s |
| id | d1b7291a2d794e26963b322c7f2a55a4 |
| internalurl | http://controller:8776/v1/%(tenant_id)s |
| publicurl | http://controller:8776/v1/%(tenant_id)s |
| region | regionOne |
| service_id | 1e494c3e22a24baaafcaf777d4d467eb |
+-------------+-----------------------------------------+$keystone endpoint-create \
--service-id $(keystone service-list | awk '/ volumev2 / {print $2}') \
--publicurl http://controller:8776/v2/%\(tenant_id\)s \
--internalurl http://controller:8776/v2/%\(tenant_id\)s \
--adminurl http://controller:8776/v2/%\(tenant_id\)s \
--region regionOne+-------------+-----------------------------------------+
| Property | Value |
+-------------+-----------------------------------------+
| adminurl | http://controller:8776/v2/%(tenant_id)s |
| id | 097b4a6fc8ba44b4b10d4822d2d9e076 |
| internalurl | http://controller:8776/v2/%(tenant_id)s |
| publicurl | http://controller:8776/v2/%(tenant_id)s |
| region | regionOne |
| service_id | 16e038e449c94b40868277f1d801edb5 |
+-------------+-----------------------------------------+The Block Storage service requires two different endpoints
to support API versions 1 and 2.To install and configure Block Storage controller componentsInstall the packages:#apt-get install cinder-api cinder-scheduler python-cinderclient#yum install openstack-cinder python-cinderclient python-oslo-db#zypper install openstack-cinder-api openstack-cinder-scheduler python-cinderclientEdit the /etc/cinder/cinder.conf file and
complete the following actions:In the [database] section, configure
database access:[database]
...
connection = mysql://cinder:CINDER_DBPASS@controller/cinderReplace CINDER_DBPASS with the
password you chose for the Block Storage database.In the [DEFAULT] section, configure
RabbitMQ message broker access:[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASSReplace RABBIT_PASS with the
password you chose for the guest account in
RabbitMQ.In the [DEFAULT] and
[keystone_authtoken] sections,
configure Identity service access:[DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = cinder
admin_password = CINDER_PASSReplace CINDER_PASS with the
password you chose for the cinder user in the
Identity service.Comment out any auth_host,
auth_port, and
auth_protocol options because the
identity_uri option replaces them.In the [DEFAULT] section, configure the
my_ip option to use the management interface IP
address of the controller node:[DEFAULT]
...
my_ip = 10.0.0.11(Optional) To assist with troubleshooting,
enable verbose logging in the [DEFAULT]
section:[DEFAULT]
...
verbose = TruePopulate the Block Storage database:#su -s /bin/sh -c "cinder-manage db sync" cinderTo install and configure Block Storage controller componentsInstall the packages:#apt-get install cinder-api cinder-scheduler python-cinderclientRespond to the prompts for
database management,
Identity service
credentials,
service endpoint
registration, and
message broker
credentials.To finalize installationRestart the Block Storage services:#service cinder-scheduler restart#service cinder-api restartStart the Block Storage services and configure them to start when
the system boots:#systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service#systemctl start openstack-cinder-api.service openstack-cinder-scheduler.serviceOn SLES:#service openstack-cinder-api start#service openstack-cinder-scheduler start#chkconfig openstack-cinder-api on#chkconfig openstack-cinder-scheduler onOn openSUSE:#systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service#systemctl start openstack-cinder-api.service openstack-cinder-scheduler.serviceBy default, the Ubuntu packages create an SQLite database.Because this configuration uses a SQL database server, you can
remove the SQLite database file:#rm -f /var/lib/cinder/cinder.sqlite