Configuring a Block Storage Controller
To create the components that control the Block Storage Service, complete the following steps on the controller node.
You can configure OpenStack to use various storage systems.
The examples in this guide show how to configure LVM.
Configure a Block Storage Controller
Install the appropriate
packages for the Block Storage Service.
# apt-get install cinder-api cinder-scheduler
# yum install openstack-cinder openstack-utils openstack-selinux
# zypper install openstack-cinder-api openstack-cinder-scheduler
Note for Debian users
As for the rest of OpenStack, the Block Storage service is configured through
debconf. So you will not need to manually configure the database, do the
cinder-manage db sync
manually, configure the Keystone auth token, or
the RabbitMQ parameters of Cinder. Therefore, all the below steps can be
skipped.
If you need to reconfigure the Block Storage packages, you can use:
# dpkg-reconfigure -plow cinder-common
or edit the configuration files and manually restart the daemons.
Remember that if your database server is installed remotely,
before installing the Block Storage service, you will need to do:
# apt-get install dbconfig-common && \
dpkg-reconfigure -plow dbconfig-common.
The Block Storage Service stores volume information in a database.
The examples in this section use the same MySQL database that is used by other OpenStack services.
Configure the Block Storage Service to use the database.
Replace
CINDER_DBPASS with a
password of your choosing.
# openstack-config --set /etc/cinder/cinder.conf \
database connection mysql://cinder:CINDER_DBPASS@controller/cinder
Edit /etc/cinder/cinder.conf
and change the [database] section.
[database]
...
# The SQLAlchemy connection string used to connect to the
# database (string value)
connection = mysql://cinder:CINDER_DBPASS@localhost/cinder
...
To create the Block Storage Service database and tables and a
cinder database user, run the
openstack-db command.
# openstack-db --init --service cinder --password CINDER_DBPASS
Using the password that you set in the previous example, log in as root to create a cinder database.
# mysql -u root -p
mysql> CREATE DATABASE cinder;
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
IDENTIFIED BY 'CINDER_DBPASS';
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
IDENTIFIED BY 'CINDER_DBPASS';
Create the database tables for the Block Storage Service.
# cinder-manage db sync
Create a cinder user. The Block Storage
Service use this user to authenticate with the Identity Service. Use the
service tenant and give the user the
admin role.
# keystone user-create --name=cinder --pass=CINDER_PASS --email=cinder@example.com
# keystone user-role-add --user=cinder --tenant=service --role=admin
Add the credentials to the file
/etc/cinder/api-paste.ini. Open the file in a text editor
and locate the section [filter:authtoken].
Make sure the following options are set:
[filter:authtoken]
paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
auth_host=controller
auth_port = 35357
auth_protocol = http
admin_tenant_name=service
admin_user=cinder
admin_password=CINDER_PASS
Register the Block Storage Service with the Identity Service
so that other OpenStack services can locate it. Register the service and
specify the endpoint using the keystone command.
# keystone service-create --name=cinder --type=volume \
--description="Cinder Volume Service"
Note the id property returned and use it to create
the endpoint.
# keystone endpoint-create \
--service-id=the_service_id_above \
--publicurl=http://controller:8776/v1/%\(tenant_id\)s \
--internalurl=http://controller:8776/v1/%\(tenant_id\)s \
--adminurl=http://controller:8776/v1/%\(tenant_id\)s
Also register a service and endpoint for version 2 of the
Block Storage Service API.
# keystone service-create --name=cinder --type=volumev2 \
--description="Cinder Volume Service V2"
Note the id property returned and use it to create
the endpoint.
# keystone endpoint-create \
--service-id=the_service_id_above \
--publicurl=http://controller:8776/v2/%\(tenant_id\)s \
--internalurl=http://controller:8776/v2/%\(tenant_id\)s \
--adminurl=http://controller:8776/v2/%\(tenant_id\)s
We now restart the cinder service with its new settings.
# service cinder-scheduler restart
# service cinder-api restart
Start the cinder services and configure them to
start when the system boots.
# service openstack-cinder-api start
# service openstack-cinder-scheduler start
# chkconfig openstack-cinder-api on
# chkconfig openstack-cinder-scheduler on