Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Cinder

Cinder is a block storage service that provides persistent storage for VM instances. It simplifies the creation and management of block storage devices. Install Cinder on the controller and storage nodes. The operations for installing Cinder on the controller node are different from those on the storage node.

Installing and Configuring Cinder on the Controller Node

  1. Create a database.
    1. Log in to the database as the root user.
      mysql -u root -p
    2. In the database, create a Cinder database and grant permissions.
      CREATE DATABASE cinder; 
      GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'CINDER_DBPASS'; 
      GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'CINDER_DBPASS'; 

      Replace CINDER_DBPASS with the password of the Cinder database. The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

    3. Exit the database.
      exit
  2. Create a Cinder service credential.
    source ~/.admin-openrc 
    openstack user create --domain default --password-prompt cinder 
    openstack role add --project service --user cinder admin 
    openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2 
    openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3

    The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

  3. Create API endpoints for the block storage service.
    openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(project_id\)s 
    openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(project_id\)s 
    openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(project_id\)s 
    openstack endpoint create --region RegionOne volumev3 public http://controller:8776/v3/%\(project_id\)s 
    openstack endpoint create --region RegionOne volumev3 internal http://controller:8776/v3/%\(project_id\)s 
    openstack endpoint create --region RegionOne volumev3 admin http://controller:8776/v3/%\(project_id\)s
  4. Install the software package.
    yum install openstack-cinder-api openstack-cinder-scheduler
  5. Configure Cinder.
    1. Open the configuration file.
      vi /etc/cinder/cinder.conf
    2. Press i to enter the insert mode and add the following content:
      [DEFAULT]    
      transport_url = rabbit://openstack:RABBIT_PASSWORD@controller
      auth_strategy = keystone 
      my_ip = 192.168.14.2 
       
      [database] 
      connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
       
      [keystone_authtoken] 
      www_authenticate_uri = http://controller:5000 
      auth_url = http://controller:5000 
      memcached_servers = controller:11211 
      auth_type = password 
      project_domain_name = Default 
      user_domain_name = Default 
      project_name = service 
      username = cinder 
      password = CINDER_PASSWORD
       
      [oslo_concurrency] 
      lock_path = /var/lib/cinder/tmp
      • The [database] field is used to configure the database parameters.
      • The [DEFAULT] field is used to configure the RabbitMQ message queue entry and my_ip.
      • The [DEFAULT] and [keystone_authtoken] fields are used to configure the identity authentication service entry.
      • The [oslo_concurrency] field is used to configure the lock path.
      • 192.168.14.2 is the management IP address of the controller node.
      • CINDER_DBPASS indicates the password of the Cinder database.
      • RABBIT_PASSWORD indicates the password of the OpenStack user in RabbitMQ.
      • CINDER_PASSWORD indicates the password of the Cinder user.
    1. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.

Installing and Configuring Cinder on the Storage Node

  1. Install the LVM package.
    yum install lvm2 device-mapper-persistent-data scsi-target-utils rpcbind nfs-utils openstack-cinder-volume openstack-cinder-backup
  2. Prepare storage devices. The following is an example.
    pvcreate /dev/sdb
    vgcreate cinder-volumes /dev/sdb
    
    vi /etc/lvm/lvm.conf
    devices {
    ...
    filter = [ "a/sdb/", "r/.*/"]
    • In the devices field, add a filter to allow the /dev/sda device and reject other devices.
    • Each item in the filter array starts with a for accept or r for reject. If the OS also uses the LVM, the associated system drive device must also be added to the filter. For example, if the /dev/sda device contains an OS, add sda to the filter.
  3. Modify the /etc/cinder/cinder.conf configuration file.
    1. Open the /etc/cinder/cinder.conf configuration file.
      vi /etc/cinder/cinder.conf
    2. Press i to enter the insert mode and add the following content:
      [DEFAULT]    
      transport_url = rabbit://openstack:RABBIT_PASSWORD@controller
      auth_strategy = keystone 
      my_ip = 192.168.14.4
      enabled_backends = lvm
       
      [database] 
      connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
       
      [keystone_authtoken] 
      www_authenticate_uri = http://controller:5000 
      auth_url = http://controller:5000 
      memcached_servers = controller:11211 
      auth_type = password 
      project_domain_name = Default 
      user_domain_name = Default 
      project_name = service 
      username = cinder 
      password = CINDER_PASSWORD 
       
      [oslo_concurrency] 
      lock_path = /var/lib/cinder/tmp
      [lvm]
      volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
      volume_group = cinder-volumes
      iscsi_protocol = iscsi
      iscsi_helper = tgtadm
      • 192.168.14.4 indicates the management IP address of the current node.
      • RABBIT_PASSWORD indicates the RabbitMQ password of the OpenStack user.
      • Replace CINDER_DBPASS with the Cinder database password and replace CINDER_PASSWORD with the Cinder user password.
    1. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  4. When Cinder uses tgtadm to attach volumes, add the following content to the end of the /etc/tgt/tgtd.conf file to ensure that tgtd can discover the iSCSI target of cinder-volume.
    include /var/lib/cinder/volumes/*
  5. Enable the storage service and configure it to start upon system startup.
    systemctl enable rpcbind.service nfs-server.service tgtd.service iscsid.service openstack-cinder-volume.service openstack-cinder-backup.service 
    systemctl start rpcbind.service nfs-server.service tgtd.service iscsid.service openstack-cinder-volume.service openstack-cinder-backup.service

Starting the Cinder Service on the Controller Node

  1. Synchronize the database.
    su -s /bin/sh -c "cinder-manage db sync" cinder
  2. Configure Nova.
    1. Open the configuration file.
      vi /etc/nova/nova.conf
    2. Press i to enter the insert mode and add the following content:
      [cinder] 
      os_region_name = RegionOne
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  3. Restart the compute API service.
    systemctl restart openstack-nova-api.service
  4. Start the Cinder service.
    systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service 
    systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service