CentOS 6
Sponsored Link

OpenStack Grizzly - Use Virtual Storage(LVM)2013/08/17

 
It's possible to use Virtual Storage provided by Cinder for Virtual Machine Instance.
This example shows to set to use LVM for Virtual Storage.
[1] Create a new Volume group for Cinder.
[root@dlp ~(keystone)]#
pvcreate /dev/sdb1

Physical volume "/dev/sdb1" successfully created
[root@dlp ~(keystone)]#
vgcreate -s 32M vg_volume01 /dev/sdb1

Volume group "vg_volume01" successfully created
[2] Configure Cinder
[root@dlp ~(keystone)]#
vi /etc/cinder/cinder.conf
# near line 11: add the volume group you created

volume_group = vg_volume01
[root@dlp ~(keystone)]#
/etc/rc.d/init.d/openstack-cinder-volume restart

Stopping openstack-cinder-volume: [ OK ]
Starting openstack-cinder-volume: [ OK ]
[3] For example, create a volume named "disk01", 10GB.
[root@dlp ~(keystone)]#
cinder create --display_name disk01 10

+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2013-08-17T13:35:11.663255      |
| display_description |                 None                 |
|     display_name    |                disk01                |
|          id         | 1f902dba-f7e0-4ab0-a7f5-fc5f78b5760b |
|       metadata      |                  {}                  |
|         size        |                  10                  |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+

[root@dlp ~(keystone)]#
cinder list

+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 1f902dba-f7e0-4ab0-a7f5-fc5f78b5760b | available |    disk01    |  10  |     None    |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
[4] Attach the volume just created to Instance.
The following example just attached to the Instance as "/dev/vdb".
[root@dlp ~(keystone)]#
nova list

+--------------------------------------+---------+---------+--------------------+
| ID                                   | Name    | Status  | Networks           |
+--------------------------------------+---------+---------+--------------------+
| 96676b36-d13f-4f13-89ab-f269b3f28273 | CentOS6 | SHUTOFF | network01=10.1.0.2 |
+--------------------------------------+---------+---------+--------------------+

[root@dlp ~(keystone)]#
nova volume-attach CentOS6 1f902dba-f7e0-4ab0-a7f5-fc5f78b5760b auto

+----------+--------------------------------------+
| Property | Value                                |
+----------+--------------------------------------+
| device   | /dev/vdb                             |
| serverId | 96676b36-d13f-4f13-89ab-f269b3f28273 |
| id       | 1f902dba-f7e0-4ab0-a7f5-fc5f78b5760b |
| volumeId | 1f902dba-f7e0-4ab0-a7f5-fc5f78b5760b |
+----------+--------------------------------------+
[5] By the way, it's possible to operate create or attach, dettach volumes on the DashBoard.
Matched Content