PackStack: How to Create OpenStack Cinder-Volumes Manually

a17f5-6a00e551c39e1c8834015436149671970c-pi
The PackStack installer for OpenStack is largely considered an installer for Test and Proof-of-Concept OpenStack environments. Being such, the PackStack Installer can automatically create a loopback device for use with Cinder if you allow it to. In my lab, I would actually rather create a separate volume for Cinder to use. Below are the steps needed to do so.

First you need to ensure that the PackStack installer is not going to try to create its loopback device. To accomplish this you must modify the Packstack Answers file. The example below shows where I have specified that PackStack should not create a volume on its own. Note that the default size for this volume would be 20gb. Keep this in mind should you want PackStack to create the Cinder Volume, as you are going to need a bit of free space.

# Create Cinder’s volumes group. This should only be done for testing
# on a proof-of-concept installation of Cinder. This will create a
# file-backed volume group and is not suitable for production usage.
CONFIG_CINDER_VOLUMES_CREATE=n

# Cinder’s volumes group size. Note that actual volume size will be
# extended with 3% more space for VG metadata.
CONFIG_CINDER_VOLUMES_SIZE=20G

In my lab environment I have attached a secondary disk to RHEL 7 vm. This disk has been named /dev/sdb by the OS.

Note that other instructions that I have seen on this topic do not show or even recommend creating a partition on your Cinder volume disk before running pvcreate. I find that its best practice to always create a partition on a disk as this helps indicate to other root users that this disk is in use.

Next partition the disk and create one partition, type LVM

[root@rhelosp ~]# fdisk /dev/sdb

Device Boot Start End Blocks Id System
/dev/sdb1 2048 41943039 20970496 8e Linux LVM

Then run pvcreate to put your disk under the control of LVM

[root@rhelosp ~]# pvcreate /dev/sdb1
Physical volume “/dev/sdb1” successfully created

Now create the volume group as shown below. Note that the volume name must be “cinder-volumes”

[root@rhelosp ~]# vgcreate cinder-volumes /dev/sdb1
Volume group “cinder-volumes” successfully created

Now you can proceed with your install.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s