![]() | Note |
|---|---|
This section describes how to configure OpenStack Block Storage
services on the Controller node and assumes that a
second node provides storage through the |
You can configure OpenStack to use various storage systems. The examples in this guide show you how to configure LVM.
Install the appropriate packages for the Block Storage Service:
# apt-get install cinder-api cinder-scheduler
Configure Block Storage to use your MySQL database. Edit the
/etc/cinder/cinder.conffile and add the following key under the[database]section. ReplaceCINDER_DBPASSwith the password for the Block Storage database that you will create in a later step.![[Note]](../common/images/admon/note.png)
Note The
/etc/cinder/cinder.conffile packaged with some distributions does not include the[database]section header. You must add this section header to the end of the file before proceeding further.[database] ... connection = mysql://cinder:
CINDER_DBPASS@controller/cinderUse the password that you set to log in as root to create a
cinderdatabase.# 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
cinderuser. The Block Storage Service uses this user to authenticate with the Identity Service. Use theservicetenant and give the user theadminrole.# keystone user-create --name=cinder --pass=
CINDER_PASS--email=[email protected]# keystone user-role-add --user=cinder --tenant=service --role=adminAdd the credentials to the file
/etc/cinder/api-paste.ini. Open the file in a text editor and locate the section[filter:authtoken]. Set the following options:[filter:authtoken] paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory auth_host=
controllerauth_port = 35357 auth_protocol = http auth_uri = http://controller:5000 admin_tenant_name=service admin_user=cinder admin_password=CINDER_PASSConfigure Block Storage to use the RabbitMQ message broker by setting these configuration keys in the
[DEFAULT]configuration group of the/etc/cinder/cinder.conffile. ReplaceRABBIT_PASSwith the password you chose for RabbitMQ.[DEFAULT] ... rpc_backend = cinder.openstack.common.rpc.impl_kombu rabbit_host =
controllerrabbit_port = 5672 rabbit_userid = guest rabbit_password =RABBIT_PASSRegister 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
idproperty 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\)sAlso register a service and endpoint for version 2 of the Block Storage Service API.
# keystone service-create --name=cinderv2 --type=volumev2 \ --description="Cinder Volume Service V2"
Note the
idproperty 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\)sRestart the cinder service with its new settings:
# service cinder-scheduler restart # service cinder-api restart

