Mindmajix

Creating volumes In OpenStack

On Cinder, a drive is called a volume. The first thing you need to do is to create a new volume in the region you want. They are block storage devices that you attach to instances to enable persistent storage. You can attach a volume to a running instance, or detach a volume and attach it to another instance at any time.

Now that we have created a Cinder volume service, we can create volumes for use by our instances. We do this under our Ubuntu client using one of the Cinder Client tool, aka the python-Cinderclient, so we are creating volumes specific to our tenancy (project).

Getting started

To begin with, ensure that you are logged into your Ubuntu client that has access to the Cinder Client tools. These packages can be installed using the following command:

sudo apt-get update
sudo apt-get install      python-cinderclient

How to do it…

Carry out the following to create a volume using Cinder Client:

     1. First, create the volume that we will attach to our instance.

# Source in our OpenStack Nova credentials
. stackrc
cinder create --display-name cookbook 1

     2. On completion, the command returns the following output:

Screenshot_633

How it works…

Creating Cinder-volumes for use within our project, cookbook, is very straightforward.

With Cinder Client, we use the create option with the following syntax:

cinder create --display_name volume_name size_Gb

Here, volume_name can be any arbitrary name with no spaces.

We can see the actual LVM volumes on c inder-volumes, using the usual LVM tools as follows:

sudo lvdisplay cinder-volumes
--- Logical volume ---
LV Name                   /dev/Cinder-volumes/volume-fc2152ff-dda9-
4c1c-b470-d95390713159
VG Name                   Cinder-volumes
LV UUID                   cwAmEF-HGOH-54sr-pOXx-lOof-iDmy-lYyBEQ
LV Write Access           read/write
LV Status                 available
# open                    1
LV Size                   1.00 GiB
Current LE                256
Segments                  1
Allocation                inherit
Read ahead sectors        auto
- currently set to        256
Block device              252:2


 http://docs.openstack.org/user-guide/dashboard_manage_volumes.html


 

0 Responses on Creating volumes In OpenStack"

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.