Note | |
---|---|
This scenario configures OpenStack Block Storage
services on the Controller node
and assumes that a
second node provides storage through the For instructions on how to configure the second node, see the section called “Configure a Block Storage service node”. |
You can configure OpenStack to use various storage systems. This example uses LVM.
Install the appropriate packages for the Block Storage service:
# apt-get install cinder-api cinder-scheduler
Configure Block Storage to use your database.
In the
/etc/cinder/cinder.conf
file, set theconnection
option in the[database]
section and replaceCINDER_DBPASS
with the password for the Block Storage database that you will create in a later step:[database] ... connection = mysql://cinder:
CINDER_DBPASS
@controller
/cinderNote In some distributions, the
/etc/cinder/cinder.conf
file does not include the[database]
section header. You must add this section header to the end of the file before you proceed.Use the password that you set to 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:
# su -s /bin/sh -c "cinder-manage db sync" cinder
Create a
cinder
user.The Block Storage service uses this user to authenticate with the Identity service.
Use the
service
tenant and give the user theadmin
role:$ keystone user-create --name=cinder --pass=
CINDER_PASS
--email=[email protected]
$ keystone user-role-add --user=cinder --tenant=service --role=adminEdit the
/etc/cinder/cinder.conf
configuration file and add this section for keystone credentials:... [keystone_authtoken] auth_uri = http://
controller
:5000 auth_host =controller
auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = cinder admin_password =CINDER_PASS
Configure Block Storage to use the RabbitMQ message broker.
In the
[DEFAULT]
section in the/etc/cinder/cinder.conf
file, set these configuration keys and replaceRABBIT_PASS
with the password you chose for RabbitMQ:[DEFAULT] ... rpc_backend = cinder.openstack.common.rpc.impl_kombu rabbit_host =
controller
rabbit_port = 5672 rabbit_userid = guest rabbit_password =RABBIT_PASS
Register the Block Storage service with the Identity service so that other OpenStack services can locate it:
$ keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage"
$ 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\)sRegister a service and endpoint for version 2 of the Block Storage service API:
$ keystone service-create --name=cinderv2 --type=volumev2 --description="OpenStack Block Storage v2"
$ 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\)sRestart the Block Storage services with the new settings:
# service cinder-scheduler restart # service cinder-api restart