Installing, Configuring, and Verifying Cinder
Cinder is a block storage service that provides persistent storage for VM instances. It simplifies the creation and management of block storage devices.
Creating the Cinder Database
Perform the following operations on the controller node.
- Access the MySQL database as the root user.
1mysql -u root -p
- Create the Cinder database and grant proper access to the Cinder database.
1 2 3 4
CREATE DATABASE cinder; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY '<PASSWORD>'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY '<PASSWORD>'; exit
In this document, all passwords are represented as <PASSWORD>. Use the actual password during the operation. The PASSWORD here is the password for accessing the Cinder database.

- Log in to the OpenStack CLI as the admin user and create service credentials and the cinder user.
1 2
source /etc/keystone/admin-openrc openstack user create --domain default --password-prompt cinder
- Add the admin role to the cinder user.
1openstack role add --project service --user cinder admin
- Create cinderv2 and cinderv3 service entities.
1 2
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2 openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
Two service entities need to be created for the Cinder service.

- Create API endpoints of the Block Storage service.
1 2 3
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

1 2 3
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

Installing and Configuring Cinder
Perform the following operations on the controller node.
- Install the software package.
1yum -y install openstack-cinder
- Edit the /etc/cinder/cinder.conf file.
1vim /etc/cinder/cinder.confPerform the following operations:
- Configure database access and replace <PASSWORD> with the correct password.
1 2
[database] connection = mysql+pymysql://cinder:<PASSWORD>@controller/cinder
- Configure RabbitMQ message queue access and replace PASSWORD with the correct password.
1 2
[DEFAULT] transport_url = rabbit://openstack:<PASSWORD>@controller
- Configure Identity service access and replace <PASSWORD> with the password selected for the cinder user in the Identity service.
DEFAULT section:
1 2
[DEFAULT] auth_strategy = keystone
keystone_authtoken section:1 2 3 4 5 6 7 8 9 10
[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 = <PASSWORD>
- Configure the my_ip option to use the management IP address of the controller node.
1 2
[DEFAULT] my_ip = 172.168.201.11
- Configure the lock path.
1 2
[oslo_concurrency] lock_path = /var/lib/cinder/tmp
- Configure database access and replace <PASSWORD> with the correct password.
- Populate the block storage database.
1su -s /bin/sh -c "cinder-manage db sync" cinder
Configuring Block Storage for Compute Nodes
Perform the following operations on the controller node.
- Open the /etc/nova/nova.conf file in edit mode.
1vim /etc/nova/nova.conf - Modify the file as follows:
1 2
[cinder] os_region_name = RegionOne
Completing Installation on the Controller Node
Perform the following operations on the controller node.
- Restart the Compute API service.
1systemctl restart openstack-nova-api.service
- Enable the Block Storage service and configure it to start as the system boots.
1 2
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

- Verify the installation on the controller node. If the state is up, the controller node is running properly.
1openstack volume service list

Integrating Ceph Block Storage
The current version does not support local storage. Ceph needs to be integrated to implement the storage function. For details, see Ceph Block Storage Deployment Guide (CentOS 7.6 & openEuler 20.03) and OpenStack and Ceph Integrated Deployment Guide.
Installing and Configuring the Storage Nodes
Perform the following operations on storage nodes.
- Install the software package.
1yum -y install openstack-cinder python2-keystone
- Edit the /etc/cinder/cinder.conf file.
1vim /etc/cinder/cinder.confPerform the following operations:
- Configure database access.
1 2
[database] connection = mysql+pymysql://cinder:<PASSWORD>@controller/cinder
<PASSWORD> indicates the password of the Block Storage database.
- Configure RabbitMQ message queue access.
1 2
[DEFAULT] transport_url = rabbit://openstack:<PASSWORD>@controller
<PASSWORD> indicates the password of the openstack user for RabbitMQ.
- Configure Identity service access.
1 2 3 4 5 6 7 8 9 10 11 12
[DEFAULT] auth_strategy = keystone [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 = <PASSWORD>
<PASSWORD> indicates the password of the cinder user for the Identity service.
- Set my_ip to the IP address of the management network port on the storage node.
1 2
[DEFAULT] my_ip = 172.168.201.12
- Add the [lvm] configuration. Use the LVM driver, cinder-volumes volume group, iSCSI protocol, and the corresponding iSCSI service to configure the LVM backend.
1 2 3 4 5
[lvm] volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = cinder-volumes target_protocol = iscsi target_helper = lioadm
- Enable the LVM backend.
1 2
[DEFAULT] enabled_backends = lvm
- Configure the location of the Image service API.
1 2
[DEFAULT] glance_api_servers = http://controller:9292
- Configure the lock path.
1 2
[oslo_concurrency] lock_path = /var/lib/cinder/tmp
- Configure database access.
Completing the Installation
Perform the following operation on storage nodes.
Enable the Block Storage volume service (including its dependencies) and configure it to start as the system boots.
1 2 |
systemctl enable openstack-cinder-volume.service systemctl start openstack-cinder-volume.service |
Verifying Cinder
Perform the following operations on the controller node.
- Log in to the OpenStack CLI as the admin user.
1source /etc/keystone/admin-openrc
- List service components to verify that each process is successfully started.
1openstack volume service list

Common Cinder Commands
Command |
Description |
|---|---|
openstack volume create --size 1 volume1 |
Creates a volume. |
openstack volume list |
Displays the volume list. |
openstack volume delete VOLNAME-OR-ID |
Deletes the selected volume. |
openstack volume snapshot create --volume VOLNAME-OR-ID SNAPSHOT-VOLNAME |
Creates a snapshot of a volume. |
openstack volume snapshot list |
Displays the snapshots of a volume. |
nova volume-attach VM_ID VOLUME_ID /dev/vdb |
Attaches a volume to a VM. |
nova volume-detach VM_ID VOLUME_ID |
Detaches a volume from a VM. |