Home / Openstack / Openstack – Configure the Block Storage – Controller Node – Part 12

Openstack – Configure the Block Storage – Controller Node – Part 12

The Openstack block storage service(cinder) provide the access to the block storage devices to the openstack instances using various back-end storage drivers like LVM ,CEPH etc.  The Block Storage API and scheduler services runs on the openstack controller node and openstack storage node is responsible to provide the volume service. You can configure N-number of storage nodes based on the requirement. To set a volume driver, use the “volume_driver” flag in /etc/cinder/cinder.conf file.

Openstack block storage service (cinder) support the following drivers as back-end storage devices.

  • Ceph RADOS Block Device (RBD)
  • Coraid AoE driver configuration
  • Dell EqualLogic volume driver
  • EMC VMAX iSCSI and FC drivers
  • EMC VNX direct driver
  • EMC XtremIO OpenStack Block Storage driver guide
  • GlusterFS driver
  • HDS HNAS iSCSI and NFS driver
  • HDS HUS iSCSI driver
  • Hitachi storage volume driver
  • HP 3PAR Fibre Channel and iSCSI drivers
  • HP LeftHand/StoreVirtual driver
  • HP MSA Fibre Channel driver
  • Huawei storage driver
  • IBM GPFS volume driver
  • IBM Storwize family and SVC volume driver
  • IBM XIV and DS8000 volume driver
  • LVM
  • NetApp unified driver
  • Nexenta drivers
  • NFS driver
  • ProphetStor Fibre Channel and iSCSI drivers
  • Pure Storage volume driver
  • Sheepdog driver
  • SolidFire
  • VMware VMDK driver
  • Windows iSCSI volume driver
  • XenAPI Storage Manager volume driver
  • XenAPINFS
  • Zadara
  • Oracle ZFSSA iSCSI Driver

 

The openstack’s default volume driver is LVM.

volume_driver = cinder.volume.drivers.lvm.LVMISCSIDriver

 

The OpenStack Block Storage service (cinder) provides  persistent storage to a virtual instance . Block Storage service (cinder) provides an infrastructure for managing volumes, and interacts with OpenStack Compute to provide volumes for instances. The service also enables management of volume snapshots, and volume types.

 

Openstack Block Storage Service Components (cinder):

Cinder services Openstack
Cinder services Openstack

 

Configure Controller node for Cinder Service:

1.Login to the Openstack Controller Node.

2.Create the database for cinder service.

root@OSCTRL-UA:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 5.5.44-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE cinder;
Query OK, 1 row affected (0.00 sec)

 

3.Grant proper access to the cinder database and set the cinder DB password.

mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'cinderdb123';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%'  IDENTIFIED BY 'cinderdb123';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
root@OSCTRL-UA:~#

 

4. Source the admin credentials to gain access to admin CLI commands.

root@OSCTRL-UA:~# cat admin.rc
export OS_USERNAME=admin
export OS_PASSWORD=admin123
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://OSCTRL-UA:35357/v2.0
root@OSCTRL-UA:~# source admin.rc
root@OSCTRL-UA:~#

 

5.Create the service credentials for cinder on keystone. Create the cinder user.

root@OSCTRL-UA:~# keystone user-create --name cinder --pass cinder123
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | b2691660485745f69015a4ee40f94db6 |
|   name   |              cinder              |
| username |              cinder              |
+----------+----------------------------------+
root@OSCTRL-UA:~#

 

6. Add the admin role for cinder user.

root@OSCTRL-UA:~# keystone user-role-add --user cinder --tenant service --role admin
root@OSCTRL-UA:~#

 

7. Create the cinder service entities for both API version 1 & version 2.

root@OSCTRL-UA:~# keystone service-create --name cinder --type volume --description "OpenStack Block Storage"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Block Storage      |
|   enabled   |               True               |
|      id     | 7a90b86b3aab43d2b1194172a14fed79 |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+
root@OSCTRL-UA:~#
root@OSCTRL-UA:~# keystone service-create --name cinderv2 --type volumev2 --description "OpenStack Block Storage"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Block Storage      |
|   enabled   |               True               |
|      id     | 716e7125e8e44414ad58deb9fc4ca682 |
|     name    |             cinderv2             |
|     type    |             volumev2             |
+-------------+----------------------------------+
root@OSCTRL-UA:~#

 

8. Create the API block storage endpoints for both Version 1 & Version 2.

root@OSCTRL-UA:~# keystone endpoint-create --service-id $(keystone service-list | awk '/ volume / {print $2}') --publicurl http://OSCTRL-UA:8776/v1/%\(tenant_id\)s --internalurl http://OSCTRL-UA:8776/v1/%\(tenant_id\)s --adminurl http://OSCTRL-UA:8776/v1/%\(tenant_id\)s --region regionOne
+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://OSCTRL-UA:8776/v1/%(tenant_id)s |
|      id     |    6a86eec28e434481ba88a153f53bb8c2    |
| internalurl | http://OSCTRL-UA:8776/v1/%(tenant_id)s |
|  publicurl  | http://OSCTRL-UA:8776/v1/%(tenant_id)s |
|    region   |               regionOne                |
|  service_id |    7a90b86b3aab43d2b1194172a14fed79    |
+-------------+----------------------------------------+
root@OSCTRL-UA:~#
root@OSCTRL-UA:~# keystone endpoint-create --service-id $(keystone service-list | awk '/ volumev2 / {print $2}') --publicurl http://OSCTRL-UA:8776/v1/%\(tenant_id\)s --internalurl http://OSCTRL-UA:8776/v1/%\(tenant_id\)s --adminurl http://OSCTRL-UA:8776/v1/%\(tenant_id\)s --region regionOne
+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://OSCTRL-UA:8776/v1/%(tenant_id)s |
|      id     |    6b9825bbe27c4f978f17b3219c1579e4    |
| internalurl | http://OSCTRL-UA:8776/v1/%(tenant_id)s |
|  publicurl  | http://OSCTRL-UA:8776/v1/%(tenant_id)s |
|    region   |               regionOne                |
|  service_id |    716e7125e8e44414ad58deb9fc4ca682    |
+-------------+----------------------------------------+
root@OSCTRL-UA:~#

 

9. Install the Block Storage controller components .

root@OSCTRL-UA:~# apt-get install cinder-api cinder-scheduler python-cinderclient
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-cinderclient is already the newest version.
python-cinderclient set to manually installed.
The following extra packages will be installed:
  cinder-common python-barbicanclient python-cinder python-networkx
  python-taskflow
Suggested packages:
  python-ceph python-hp3parclient python-scipy python-pydot
The following NEW packages will be installed:
  cinder-api cinder-common cinder-scheduler python-barbicanclient
  python-cinder python-networkx python-taskflow
0 upgraded, 7 newly installed, 0 to remove and 37 not upgraded.
Need to get 1,746 kB of archives.
After this operation, 14.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

 

10 .Edit the /etc/cinder/cinder.conf file and complete the following actions like below.

  • Update the Database info.
[database]
connection = mysql://cinder:cinderdb123@OSCTRL-UA/cinder
  • Update Rabbit MQ info
[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = OSCTRL-UA
rabbit_password = rabbit123
  • Update the “auth_strategy” in DEFAULT section.
[DEFAULT]
auth_strategy = keystone
  • Update keystone credentials.
[keystone_authtoken]
auth_uri = http://OSCTRL-UA:5000/v2.0
identity_uri = http://OSCTRL-UA:35357
admin_tenant_name = service
admin_user = cinder
admin_password = cinder123
  • Update the “my_ip” option to use the management interface IP address of the controller node.
[DEFAULT]
.....
my_ip = 192.168.203.130
  • Enable the verbose .
[DEFAULT]
.....
verbose = True

 

11. Populate the change in cinder database.

root@OSCTRL-UA:~# su -s /bin/sh -c "cinder-manage db sync" cinder
2015-10-20 04:37:00.143 9423 INFO migrate.versioning.api [-] 0 -> 1...
2015-10-20 04:37:00.311 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.312 9423 INFO migrate.versioning.api [-] 1 -> 2...
2015-10-20 04:37:00.424 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.431 9423 INFO migrate.versioning.api [-] 2 -> 3...
2015-10-20 04:37:00.464 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.466 9423 INFO migrate.versioning.api [-] 3 -> 4...
2015-10-20 04:37:00.518 9423 INFO 004_volume_type_to_uuid [-] Created foreign key volume_type_extra_specs_ibfk_1
2015-10-20 04:37:00.522 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.522 9423 INFO migrate.versioning.api [-] 4 -> 5...
2015-10-20 04:37:00.538 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.539 9423 INFO migrate.versioning.api [-] 5 -> 6...
2015-10-20 04:37:00.553 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.554 9423 INFO migrate.versioning.api [-] 6 -> 7...
2015-10-20 04:37:00.571 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.571 9423 INFO migrate.versioning.api [-] 7 -> 8...
2015-10-20 04:37:00.582 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.582 9423 INFO migrate.versioning.api [-] 8 -> 9...
2015-10-20 04:37:00.599 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.600 9423 INFO migrate.versioning.api [-] 9 -> 10...
2015-10-20 04:37:00.612 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.613 9423 INFO migrate.versioning.api [-] 10 -> 11...
2015-10-20 04:37:00.637 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.637 9423 INFO migrate.versioning.api [-] 11 -> 12...
2015-10-20 04:37:00.654 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.654 9423 INFO migrate.versioning.api [-] 12 -> 13...
2015-10-20 04:37:00.670 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.670 9423 INFO migrate.versioning.api [-] 13 -> 14...
2015-10-20 04:37:00.687 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.688 9423 INFO migrate.versioning.api [-] 14 -> 15...
2015-10-20 04:37:00.698 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.698 9423 INFO migrate.versioning.api [-] 15 -> 16...
2015-10-20 04:37:00.719 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.720 9423 INFO migrate.versioning.api [-] 16 -> 17...
2015-10-20 04:37:00.758 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.759 9423 INFO migrate.versioning.api [-] 17 -> 18...
2015-10-20 04:37:00.786 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.787 9423 INFO migrate.versioning.api [-] 18 -> 19...
2015-10-20 04:37:00.802 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.803 9423 INFO migrate.versioning.api [-] 19 -> 20...
2015-10-20 04:37:00.817 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.818 9423 INFO migrate.versioning.api [-] 20 -> 21...
2015-10-20 04:37:00.829 9423 INFO 021_add_default_quota_class [-] Added default quota class data into the DB.
2015-10-20 04:37:00.836 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.837 9423 INFO migrate.versioning.api [-] 21 -> 22...
2015-10-20 04:37:00.850 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.851 9423 INFO migrate.versioning.api [-] 22 -> 23...
2015-10-20 04:37:00.875 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.875 9423 INFO migrate.versioning.api [-] 23 -> 24...
2015-10-20 04:37:00.906 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.906 9423 INFO migrate.versioning.api [-] 24 -> 25...
2015-10-20 04:37:00.958 9423 INFO migrate.versioning.api [-] done
2015-10-20 04:37:00.958 9423 INFO migrate.versioning.api [-] 25 -> 26...
2015-10-20 04:37:00.966 9423 INFO 026_add_consistencygroup_quota_class [-] Added default consistencygroups quota class data into the DB.
2015-10-20 04:37:00.970 9423 INFO migrate.versioning.api [-] done
root@OSCTRL-UA:~#

 

12. Restart the block storage services.

root@OSCTRL-UA:~# service cinder-scheduler restart
cinder-scheduler stop/waiting
cinder-scheduler start/running, process 9444
root@OSCTRL-UA:~# service cinder-api restart
cinder-api stop/waiting
cinder-api start/running, process 9466
root@OSCTRL-UA:~#

 

13.By default, the Ubuntu packages create an SQLite database.Just delete it since we are using mysql.

root@OSCTRL-UA:~# rm -f /var/lib/cinder/cinder.sqlite
root@OSCTRL-UA:~#

We have just configured the block storage service on controller node. We yet to configure the storage node to provide the volume service to the instances. In the next article, we will configure storage node & will test it by launching new instance using volume.

Hope this article is informative to you. Share it ! Be sociable !!!

VMTURBO-CLOUD-CAPACITY

Leave a Reply

Your email address will not be published. Required fields are marked *