OpenStack:Cinder
lastmod 2025-02-14created 2016-06-1020 edits
The OpenStack Block Storage service provides block storage devices to guest instances. How storage is provisioned and consumed is determined by the Block Storage driver, or by drivers in the case of a multi-backend configuration. Many drivers are available, such as NAS/SAN, NFS, iSCSI, and Ceph. The Block Storage API and scheduler services usually run on the controller nodes. Depending on the driver used, the volume service can run on controllers, Compute nodes, or standalone storage nodes.
File
-
/etc/cinder/cinder.conf - Cinder configuration file.
-
/var/log/cinder/* - Cinder log file directory.
List of command
-
cinder list - Print the list of all volumes.
-
cinder type-list - Print the list of Types.
-
cinder service-list - Check the list of Block Storage services.
-
cinder extra-specs-list - Extra space list.
Service reboot
Start the Block Storage volume service and its related services, and configure them to start automatically when the system boots:
$ systemctl enable openstack-cinder-volume.service target.service
$ systemctl start openstack-cinder-volume.service target.service
To restart, enter the following.
$ service openstack-cinder-api restart
$ service openstack-cinder-scheduler restart
$ service openstack-cinder-volume restart
Create multiple backends
- Cinder-multi-backend
- Creating Volumes for OpenStack Block Storage
- OpenStack - Install and configure a storage node
- [Recommended] adding an openstack cinder volume server to an existing cloud with an existing cinder setup
- [Recommended] OpenStack Cinder – Add Additional Backend Volumes
- 8.4.2. Configuring for LVM Storage Backend
- Chapter 10. Deploying Volume Services (Cinder)
- [Recommended] LVMiSCSI cinder backend for RDO Juno on CentOS 7
First connect the physical HDD, then partition it using parted.
# parted /dev/sdb
(parted) mklabel gpt
(parted) unit TB
(parted) mkpart primary 0.00TB 4.00TB
(parted) set 1 lvm on
(parted) print
Create an LVM physical volume and volume group.
$ pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
$ vgcreate cinder-volumes2 /dev/sdb1
Volume group "cinder-volumes2" successfully created
## pvscan, vgdisplay, lsblk, vgs
Add the new Backend to /etc/cinder/cinder.conf.
enabled_backends=lvm51,lvm52
# ...
[lvm]
iscsi_helper=lioadm
iscsi_ip_address=192.168.1.100
volume_driver=cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir=/var/lib/cinder/volumes
volume_backend_name=lvm
[lvm2]
iscsi_helper=lioadm
iscsi_ip_address=192.168.1.100
volume_driver=cinder.volume.drivers.lvm.LVMVolumeDriver
#volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver # Not work !!
volume_group=cinder-volumes2
volume_backend_name=lvm2
Run the cinder commands.
[root@server ~(keystone_yourname)]# cinder type-create iscsi2
[root@server ~(keystone_yourname)]# cinder type-list
+--------------------------------------+--------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+--------+-------------+-----------+
| c277d5f5-03d3-4933-beae-c534f60ec916 | iscsi | - | True |
| f08fc302-2589-4c2e-bba0-fb681c2a6141 | iscsi2 | - | True |
+--------------------------------------+--------+-------------+-----------+
[root@server ~(keystone_yourname)]# cinder type-key iscsi2 set volume_backend_name=lvm2
[root@server ~(keystone_yourname)]# cinder create --volume_type iscsi2 --display_name instance_lvm 1024
[root@server ~(keystone_yourname)]# cinder extra-specs-list
Resize volume
LVM Volume group
You can check the Cinder-related groups with the LVM vgdisplay command. Note that the group name installed by default through RDO is cinder-volumes.
Troubleshooting
Insufficient free space for volume creation on host
If the Volume's Status is Error, checking /var/log/cinder/scheduler.log may show messages like the following.
2017-01-22 21:25:51.404 31276 WARNING cinder.scheduler.filters.capacity_filter [req-0fed2786-91f1-42f8-8e0f-c690551f5021 4928fd0043b34cd2a747637aefe85bc4 51fef98cf24243329fd360d8f2872f69 - - -] Insufficient free space for volume creation on host server@lvm2#lvm2 (requested / avail): 1/0.0
2017-01-22 21:25:51.404 31276 INFO cinder.scheduler.base_filter [req-0fed2786-91f1-42f8-8e0f-c690551f5021 4928fd0043b34cd2a747637aefe85bc4 51fef98cf24243329fd360d8f2872f69 - - -] Filter CapabilitiesFilter returned 0 host(s)
2017-01-22 21:25:51.405 31276 WARNING cinder.scheduler.filter_scheduler [req-0fed2786-91f1-42f8-8e0f-c690551f5021 4928fd0043b34cd2a747637aefe85bc4 51fef98cf24243329fd360d8f2872f69 - - -] No weighed hosts found for volume with properties: {u'name': u'iscsi2', u'qos_specs_id': None, u'deleted': False, u'created_at': u'2017-01-16T15:01:00.000000', u'updated_at': None, u'extra_specs': {u'volume_backend_name': u'lvm2'}, u'is_public': True, u'deleted_at': None, u'id': u'f08fc302-2589-4c2e-bba0-fb681c2a6141', u'description': None}
2017-01-22 21:25:51.408 31276 ERROR cinder.scheduler.flows.create_volume [req-0fed2786-91f1-42f8-8e0f-c690551f5021 4928fd0043b34cd2a747637aefe85bc4 51fef98cf24243329fd360d8f2872f69 - - -] Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create: No valid host was found. No weighed hosts available
Check the free space of the physical device connected to that volume. For reference, I checked the free space using LVM's vgdisplay.
List of OpenStack Service
| Main | |
| Storage | |
| Shared services | |
| Higher-level services | |
| ETC | |
See also
Favorite site
- Add the Block Storage service
- Install and configure a storage node
- adding an openstack cinder volume server to an existing cloud with an existing cinder setup
- Cinder - RDO - No valid host was found - multiple storage back end
- How to Setup OpenStack to use Local Disks for Instances
- PackStack: How to Create OpenStack Cinder-Volumes Manually
- Creating volumes with Cinder commands
- Handling errors when attaching a volume to an OpenStack instance