• Resources
  • Blog
  • (Tutorial) What is Cinder and how to install and use it?

(Tutorial) What is Cinder and how to install and use it?

Introduction

Cinder is a persistent block level storage device for use with OpenStack compute instances. It manages the creation, attachment and detachment of block devices to servers. In addition to using simple Linux server storage, Cinder provides unified storage support for numerous other storage platforms, including Ceph, NetApp, Nexenta, SolidFire and Zadara.

It provides snapshot management functionality for backing up data stored on block storage volumes that can be restored or used to create new block storage volumes.

[Tweet "What is #Cinder and how to install and use it?"]

Cinder includes the following components:

cinder-api: Accepts API requests and routes them to cinder-volume for action.

cinder-volume: Responds to requests to read from and write to a block storage database to maintain state by interacting with other processes, like cinder-scheduler, through a message queue, and to act directly upon block-storage providing hardware or software. It can interact with a variety of storage providers through driver architecture.

cinder-scheduler: Picks the optimal block storage provider node on which to create the volume.

Messaging queue: Routes information between Block Storage Service processes.

cinder

Installing Cinder


Install Cinder services.

# apt-get install cinder-api cinder-scheduler cinder-volume

Create database. Glance uses a database to store information. Here we’ll use MySQL as the default database.

#mysql

> create database cinder;

> grant all privileges on glance.* to cinderUser@localhost identified by ‘StrongPass’;

> grant all privileges on keystone.* to cinderUser@'%' identified by ‘StrongPass’;

Create a cinder user and add the user to tenant service with an admin role.

# keystone user-create --name=cinder --pass=90b68569e6da --email=cinder@flux7.com

# keystone user-role-add --user=cinder --tenant=service --role=admin

Register the cinder service at Keystone.

# keystone service-create --name=cinder --type=volume --description="Cinder Volume Service"

Create a cinder endpoint. For the service-id, use the id generated for the Glance service.

# keystone endpoint-create --service-id=a3f9c625a3b9443f8e66bf4e5de2349f \

--publicurl=http://192.168.100.10:8776/v1/%\(tenant_id\)s \

--internalurl=http://192.168.100.10:8776/v1/%\(tenant_id\)s \

--adminurl=http://192.168.100.10:8776/v1/%\(tenant_id\)s

Also 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 id property returned and use it to create the endpoint.

# keystone endpoint-create --service-id=a3f9c625a3b9443f8e66bf4e5de2349f \

--publicurl=http://192.168.100.10:8776/v2/%\(tenant_id\)s \

--internalurl=http://192.168.100.10:8776/v2/%\(tenant_id\)s \

--adminurl=http://192.168.100.10:8776/v2/%\(tenant_id\)s

Edit /etc/cinder/cinder.conf and change the database connection string under the [database] section.

[database]

...

connection = mysql://cinderUser:StrongPass@localhost/cinder

Also change rabbitmq details if required:-

[DEFAULT]

...

rpc_backend = cinder.openstack.common.rpc.impl_kombu

rabbit_host = controller

rabbit_port = 5672

rabbit_userid = guest

rabbit_password = RABBIT_PASS

Finally, add the credentials to the file /etc/cinder/api-paste.ini under section [filter:authtoken].

[filter:authtoken]

paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory

auth_uri = http://192.168.100.10:5000

auth_host = 192.168.100.10

auth_port = 35357

auth_protocol = http

admin_tenant_name = service

admin_user = cinder

admin_password = 90b68569e6da

Watch out the next tutorial on how to Neutron - Openstack's Network Service.

April 03, 2014 / Openstack

Share the Post

About the Author

Flux7 Labs

Subscribe to Email Updates

Connect With Us