Atom feed of this document
  
 

 Configure a Block Storage service controller

[Note]Note

This scenario configures OpenStack Block Storage services on the Controller node and assumes that a second node provides storage through the cinder-volume service.

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.

  1. Install the appropriate packages for the Block Storage service:

    # apt-get install cinder-api cinder-scheduler
  2. Configure Block Storage to use your database.

    In the /etc/cinder/cinder.conf file, set the connection option in the [database] section and replace CINDER_DBPASS with the password for the Block Storage database that you will create in a later step:

    [database]
    ...
    connection = mysql://cinder:CINDER_DBPASS@controller/cinder
    [Note]Note

    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.

  3. 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';
  4. Create the database tables for the Block Storage service:

    # su -s /bin/sh -c "cinder-manage db sync" cinder
  5. 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 the admin role:

    $ keystone user-create --name=cinder --pass=CINDER_PASS --email=[email protected]
    $ keystone user-role-add --user=cinder --tenant=service --role=admin
  6. Edit 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
  7. 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 replace RABBIT_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
  8. 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\)s
  9. Register 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\)s
  10. Restart the Block Storage services with the new settings:

    # service cinder-scheduler restart
    # service cinder-api restart
Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page

loading table of contents...