Openstack installation : Block storage – Cinder (on Compute Node)

Content from “”, listed here with minor/no changes – just noting down what I did – online notes.

Wanted to get rid of all partition info in /dev/sdb so that I can use it for block storage.

#dd if=/dev/zero of=/dev/sdb bs=1k count=1000000
#blockdev --rereadpt /dev/sdb

Install the supporting utility packages

#apt install --assume-yes lvm2 thin-provisioning-tools

Create the LVM physical volume /dev/sdb

# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.

Create the LVM volume group cinder-volumes (Note the volume group name)

# vgcreate cinder-volumes /dev/sdb
Volume group "cinder-volumes" successfully created

Only instances can access Block Storage volumes. However, the underlying operating system manages the devices associated with the volumes. By default, the LVM volume scanning tool scans the /dev directory for block storage devices that contain volumes. If projects use LVM on their volumes, the scanning tool detects these volumes and attempts to cache them which can cause a variety of problems with both the underlying operating system and project volumes. Reconfigure LVM to scan only the devices that contain the cinder-volumes volume group. Edit /etc/lvm/lvm.conf and in the devices section un-comment the filter configuration and amend it to allow /dev/sdb to be scanned and not others.

devices {
. . .
filter = [ "a/sdb/", "r/.*/"]
. . .

Install the cinder packages

#apt install --assume-yes cinder-volume

Edit the /etc/cinder/cinder.conf – Required configurations – add sections if not found

enabled_backends = lvm
glance_api_servers = http://controller:9292
transport_url = rabbit://openstack:{pasword}@controller
auth_strategy = keystone

connection = mysql+pymysql://cinder:{password}@controller/cinder

auth_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = {password}

volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = tgtadm

lock_path = /var/lib/cinder/tmp

Finalize : Restart services

#service tgt restart
#service cinder-volume restart

About sandeep

Passionate about sharing information on "how to".
This entry was posted in Installation / How To, Notes and tagged , , , , , , , . Bookmark the permalink.