Tuesday, November 7, 2017

Configuring the block storage (cinder) in openstack - controller part

Cinder is the block storage server in openstack configuration . This setup is designed to consume storage devices either from local storage through  LVM or third party devices for the computer node NOVA.

In our case we will use the default LVM as a storage device which will share to the instances which we created earlier . ( as we don't have separate storage node configured we will use controller node as storage) 

The cinder  architecture 














Cinder-API - This is a wsgi based api which will routes and authenticate the requests to the block storage service. It supports openstack API which will call as a cinder client ( Nova EC2 instances also supports this as an alternate)

Cinder -Scheduler - This will schedule the  requests and route it to appropriate volume service as per your configuration .

Cinder Volume - This is the back end storage devices . typically the devices which are supported are given below

  • 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
Cinder backup - Provides the cinder back up to various targets.

Cinder work flow 






















  • A volume is created through the cinder create command. This command creates an LV into the volume group (VG) “cinder-volumes.”
  • The volume is attached to an instance through the nova volume-attach command. This command creates a unique iSCSI IQN that is exposed to the compute node.
  • The compute node, which runs the instance, now has an active iSCSI session and new local storage (usually a /dev/sdX disk).
  • Libvirt uses that local storage as storage for the instance. The instance get a new disk, usually a /dev/vdX disk.

While entering to the configuration side we have two parts for the configuration . 
configuration of the controller side and configuration of the storage node side. But as i mentioned earlier we have no storage node configured separately due to the limitation in my lab and we will configure both in controller node  

Configuring the controller node for cinder setup

  •  Login to the CTRL node as root
  • Create the databases for cinder service 
root@CTRL:~# 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)
  • Provide the proper access to the cinder database and set the password for the cinder DB.
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'Onm0bile';
Query OK, 0 rows affected (0.00 sec)

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

mysql> exit
Bye
root@CTRL:~#

  • Now we need to access the admin commands using source the admin.rc file 
root@CTRL:~# cat admin.rc
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://CTRL:35357/v2.0
root@CTRL:~# source admin.rc
root@CTRL:~#
  • Create the service credentials for cinder using keystone command . We need to create cinder user
root@CTRL:~# keystone user-create --name cinder --pass Onm0bile
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | c1791460385745f79015a4ee40f94db8 |
|   name   |              cinder              |
| username |              cinder              |
+----------+----------------------------------+
root@CTRL:~#

  • Add admin role to the cinder user 
root@CTRL:~# keystone user-role-add --user cinder --tenant service --role admin
root@CTRL:~#
  • Create the cinder service entities for both cinder API V1 and V2 
(currently the block storage API versions are up to 3 and we will only use 2)

root@CTRL:~# keystone service-create --name cinder --type volume --description "OpenStack Block Storage"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Block Storage      |
|   enabled   |               True               |
|      id     | 6c91s86b3acb23d2b1294171c14fed68 |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+
root@CTRL:~#
root@CTRL:~# keystone service-create --name cinderv2 --type volumev2 --description "OpenStack Block Storage"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Block Storage      |
|   enabled   |               True               |
|      id     | 414d7125e8e44314ce58beb8fc4ca781|
|     name    |             cinderv2             |
|     type    |             volumev2             |
+-------------+----------------------------------+
root@OSCTRL-UA:~#

  • Create the API storage end points for version1 and version 2
keystone endpoint-create --service-id $(keystone service-list | awk '/ volume / {print $2}') --publicurl http://CTRL:8776/v1/%\(tenant_id\)s --internalurl http://CTRL:8776/v1/%\(tenant_id\)s --adminurl http://CTRL:8776/v1/%\(tenant_id\)s --region regionOne


keystone endpoint-create --service-id $(keystone service-list | awk '/ volume / {print $2}') --publicurl http://CTRL:8776/v2/%\(tenant_id\)s --internalurl http://CTRL:8776/v2/%\(tenant_id\)s --adminurl http://CTRL:8776/v2/%\(tenant_id\)s --region regionOne


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

  • Next we have to install the cinder components 
root@CTRL:~# yum 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
  • Edit the /etc/cinder/cinder.conf file and configure as below 
Database session 

[database]
connection = mysql://cinder:Onm0bile@CTRL/cinder
Rabbit MQ configuration 

[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = CTRL
rabbit_password = Onm0bile
Update the auth_stratery in default session 

[DEFAULT]
auth_strategy = keystone
Update the keystone credentials 

[keystone_authtoken]
auth_uri = http://CTRL:5000/v2.0
identity_uri = http://CTRL:35357
admin_tenant_name = service
admin_user = cinder
admin_password = Onm0bile
Update the my_ip option to access the management IP of the controller node 

[DEFAULT]
.....
my_ip = 192.168.24.10
Enable the verbose 

[DEFAULT]
.....
verbose = True
Populate the configuration in cinder database 

root@CTRL:~# su -s /bin/sh -c "cinder-manage db sync" cinder
2017-11-07 04:37:00.143 9423 INFO migrate.versioning.api [-] 0 -> 1...
2017-11-07 04:37:00.311 9423 INFO migrate.versioning.api [-] done
2017-11-07 04:37:00.312 9423 INFO migrate.versioning.api [-] 1 -> 2...
2017-11-07 04:37:00.424 9423 INFO migrate.versioning.api [-] done
....out put is omitted....
Restart the cinder services once the database update finishes 

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

I will cover the storage part on next session 


5 comments:

  1. Hi,
    Thank you very much for information about on Configuring the block storage (cinder) in openstack, And i hope this will be useful for many people. Keep on updating these kinds of knowledgeable things. I would like to share some more interesting info about OpenStack Administration Online Training.

    ReplyDelete
  2. This concept is a good way to enhance the knowledge.thanks for sharing.. Great article ...Thanks for your great information, the contents are quiet interesting.
    Openstack Training
    Openstack Training Online
    Openstack Training in Hyderabad

    ReplyDelete
  3. Nice Article it is very interesting to read, i like it Cinder work flow

    ReplyDelete
  4. Great blog post! I appreciate how you've explained the role and responsibilities of an AWS Solutions Architect. It's a very clear and concise overview. Please visit our website:- aws solution architect

    ReplyDelete