OpenStack:Havana:Cinder-Volume-Test

From DocWiki

Contents

Overview

This guide will provide a quick walk through of using the Cisco OpenStack Installer (COI) Havana Release 2 (H.2) to setup and use Cinder volumes for persistent storage on intances. This guide is not meant to provide a primer on the various storage options in OpenStack or a primer on Cinder block storage itself. This guide is meant to help you quickly leverage the Cinder support that is included in COI and to validate a basic working setup.

The default COI setup, regardless of scenario (i.e All-in-One, 2_role, Compressed HA, etc...), provides a basic Cinder setup which includes the deployment of pre-set values in the /etc/cinder/cinder.conf file. Namely, the setting that is discussed in this document is the name of the default Cinder volume which is cinder-volumes.

Assumptions

You have used COI to setup a scenario such as the All-in-One (AIO) scenario.

You have a physical hard drive or a logical hard drive (i.e. a second VMware disk attached to a VM) on that node that can be used as the cinder-volume (Note:You can create a physical volume and volume group that is a partition and only using a portion of the drive or you can configure Cinder to use loopbacks for testing [not discussed in this guide])

Pre-Check and Configuration of the Physical/Logical Drive

In the example that will be used in this guide, there is a 5 Gig virtual hard drive that is attached to the COI AIO node being used as the test machine.

Check that the /etc/cinder/cinder.conf file does have the "cinder-volumes" name set:

Now, you can begin using the Cinder client via CLI or via the OpenStack Dashboard to create a Cinder volume that will use the volume group you just created and attach that to a running instance.

For example, if you wanted to create a 1 GB Cinder volume named "test-volume" out of the 5 GB volume group that you created earlier and attach that to a running instance you would follow these steps via CLI:

SSH into a running instance and verify which partitions are already setup on that instance (Note: Some distributions may use multiple partitions and it is not safe to assume that /dev/vda is the only partition in use):

Note the last partition entry. In this example, the Fedora instance is already using /dev/vda and /dev/vdb so the next available partition that can be used is /dev/vdc. Back on the AIO node (or whatever node you are using to run your nova and cinder commands) you can use the following syntax to attach the volume to the instance: