Starting OpenStack Block Storage

Recommended by 0 users


Data written to currently running instances on disks is not persistent—meaning that when you terminate such instances, any disk writes will be lost. Volumes are persistent storage that you can attach to your running OpenStack Compute instances; the best analogy is that of a USB drive that you can attach to an instance. Like USB drives, you can only attach instances to only one computer at a time.

In prior OpenStack releases, volume services were provided by nova-volume, which has evolved over time into OpenStack Block Storage, aka Cinder. OpenStack Block Storage is very similar to Amazon EC2’s Elastic Block Storage—the difference is in how volumes are presented to the running instance.

Block storage (sometimes referred to as volume storage) provides users with access to block-storage devices. Users interact with block storage by attaching volumes to their running VM instances.

These volumes are persistent: they can be detached from one instance and re-attached to another, and the data remains intact. Block storage is implemented in OpenStack by the OpenStack Block Storage (cinder) project, which supports multiple back ends in the form of drivers. Your choice of a storage back end must be supported by a Block Storage driver.

Under OpenStack Compute, volumes can easily be managed using an iSCSI exposed LVM volume group named cinder-volumes, so this must be present on any host running the service Cinder volume.

At times, managing OpenStack Block storage can be confusing as Cinder volume is the running service name and cinder -volumes is the name of the LVM Volume Group that is exposed by the Cinder-volume service.

Configuring Cinder volume services

After you configure the services on the controller node, configure a second system to be a Block Storage.

In this recipe, we will configure an additional VirtualBox VM to host the volumes and prerequisites that cinder-volume.

Cinder  is the  default block storage service on Openstack. Cinder service manages the volumes , volume snapshots, and volume types.

Getting started

To use Cinder volumes, we will make some changes to our Vagrantfile to provide an additional Virtual Machine. This VM will provide a loopback filesystem on which we will build the LVM volumes as well as install the required services for Cinder.


OpenStack Block Storage and Cinder will be used interchangeably in this particular field of topics.

How to achieve it…

First, we edit our Vagrantfile to add an additional VM so we can boot it and then set up LVM. Once the VM is created and powered on, we will setup a loopback filesystem and setup LVM appropriately. Following that, we will install and configure prerequisites such as open-iscsi. Finally, we will configure Cinder.

For adding a new VirtualBox Virtual Machine to your Vagrant File perform the following steps:

  • Open your Vagrantfile for editing.
  • Under the nodes section, add the following line for the Cinder node:

nodes = {

     ‘cinder’          => [1, 211],


What this line does is, it tells Vagrant to build a single VM whose IP addresses will end in .211.

Power this VM on:

vagrant up cinder
  • To configure your new VM for use by Cinder-volume perform following steps:

Log into the new VM

vagrant ssh cinder
  • Install prerequisites:
# Install some dependencies
sudo apt-get install -y linux-headers-'uname -r' build-essential python-mysqldb xfsprogs
sudo apt-get install -y cinder-api cinder-scheduler cinder-volume open-iscsi python-cinderclient tgt iscsitarget iscsitarget-dkms
  • Now we need to restart open-iscsi:
sudo service open-iscsi restart

To create a loopback filesystem and set up LVM for use with cinder-volume perform following steps:

  • First, we create a 5 GB file that will be used for the loopback filesystem:
dd if=/dev/zero of=cinder-volumes bs=1 count=0 seek=5G

Once that file is made, we create the loopback filesystem:

sudo losetup /dev/loop2 Cinder-volumes
  • Finally, we create the LVM setup required for Cinder-volume:
sudo pvcreate /dev/loop2
sudo vgcreate cinder-volumes /dev/loop2


It is important to note that this is not a persistent file system. Rather, it is shown here for demonstration. In a production setup, you would use an actual volume, rather than a loopback file, and set it up to mount persistently.

How it works…

In order for us to use cinder- volume, we need to prepare a suitable disk or partition that has been configured as an LVM volume and that is specifically named as cinder-volumes. For our virtual environment, we simply create a loopback filesystem that we can then set up to be part of this LVM volume group. In a physical installation, the steps are no different. We simply configure a partition to be of type 8e (Linux LVM) in fdisk and then add this partition to a volume group named c inder-volumes.

Once done, we then install the required cinder-volume packages and supporting services. As cinder-volume uses iSCSI as the mechanism for attaching a volume to an instance, we install the appropriate packages that are required to run iSCSI targets.


Related Pages:

Sample Resume:

Interview Questions:


0 Responses on Starting OpenStack Block Storage"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.