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:
# zypper install openstack-cinder-api openstack-cinder-scheduler
Configure Block Storage to use your database.
Run the following command to set
connection
option in the[database]
section, which is in the/etc/cinder/cinder.conf
file, replaceCINDER_DBPASS
with the password for the Block Storage database that you will create in a later step:# openstack-config --set /etc/cinder/cinder.conf \ database connection mysql://cinder:
CINDER_DBPASS
@controller
/cinderUse 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 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:# openstack-config --set /etc/cinder/cinder.conf DEFAULT \ auth_strategy keystone # openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ auth_uri http://
controller
:5000 # openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ auth_hostcontroller
# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ auth_protocol http # openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ auth_port 35357 # openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ admin_user cinder # openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ admin_tenant_name service # openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ admin_passwordCINDER_PASS
Configure Block Storage to use the RabbitMQ message broker.
Replace
RABBIT_PASS
with the password you chose for RabbitMQ:# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_host controller # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_port 5672 # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT 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\)sStart and configure the Block Storage services 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