Hurry! 20% Off Ends SoonRegister Now

Starting OpenStack Block Storage

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.

Enthusiastic about exploring the skill set of Openstack? Then, have a look at the OpenStack Training together with additional knowledge. 

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.

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.

MindMajix YouTube Channel

Related Article: OpenStack Object Storage

How to start OpenStack Block Storage

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 set up 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.

Related Article: OpenStack Interview Questions for Freshers 

Power this VM on:
cinder

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

Log into the new VM
login

  • Install prerequisites:
prerequisites
  • Now we need to restart open-iscsi:
open-iscsi
To create a loopback filesystem and set up LVM for use with cinder-volume perform the following steps:
  • First, we create a 5 GB file that will be used for the loopback filesystem:
loopback file
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:
Cinder-volume
Related Article: OpenStack Object Storage

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.

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 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 cinder-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.

Explore OpenStack Sample Resumes! Download & Edit, Get Noticed by Top Employers!
 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
OpenStack TrainingDec 24 to Jan 08View Details
OpenStack TrainingDec 28 to Jan 12View Details
OpenStack TrainingDec 31 to Jan 15View Details
OpenStack TrainingJan 04 to Jan 19View Details
Last updated: 03 Apr 2023
About Author

Ravindra Savaram is a Technical Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

read less
  1. Share:
OpenStack Articles