OpenStack Volume Management with Cinder

OpenStack Volume Management with Cinder

OpenStack-Cinder is responsible for the block storage service of OpenStack. In other words, it manages the Volumes represented in the OpenStack infrastructure. It is equivalent to the Volume Management section of the Horizon dashboard. See OpenStack’s documentation for more details: https://wiki.openstack.org/wiki/Cinder

Notes:
  • Before you can start working with Cinder, you will need to install and configure the OpenStack CLI tools on your workstation.
  • OpenStack volumes are only available for AgileCLOUD servers

Cinder allows you to:

  • Create/Delete empty volumes to add storage to a AgileCLOUD server
  • Copy a Glance image to a volume in order to boot on it.
  • Clone volumes in order to duplicate AgileCLOUD servers

Like with every other OpenStack CLI tools, you can always refer to the “help” feature for further instructions and details.

$ cinder help

 


Here are a few examples of Cinder’s usage:

  • List the volumes available in your account and display some information about them with cinder list

 

$ cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  |     Name     | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 47be447d-57e2-4baf-89ec-559beab3cb8d | available | test_volume1 |  5   |  solidfire0 |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

 

  • Show the complete details of a specific volume with cinder show volume_uuid
$ cinder show 47be447d-57e2-4baf-89ec-559beab3cb8d
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
| consistencygroup_id |                 None                 |
|      created_at     |      2016-09-01T15:05:31.000000      |
|     description     |                 None                 |
|      encrypted      |                False                 |
|          id         | 47be447d-57e2-4baf-89ec-559beab3cb8d |
|       metadata      |                  {}                  |
|     multiattach     |                False                 |
|         name        |             test_volume1             |
|  replication_status |               disabled               |
|         size        |                  5                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |              available               |
|       user_id       |   62920a6ecd354e87a691eafa6194d5fb   |
|     volume_type     |              solidfire0              |
+---------------------+--------------------------------------+

 

  • Create an empty volume with cinder create
$ cinder create 10 --display-name test_volume2
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
| consistencygroup_id |                 None                 |
|      created_at     |      2016-09-01T15:13:27.000000      |
|     description     |                 None                 |
|      encrypted      |                False                 |
|          id         | de152e8d-f08e-4b0f-bae4-47b0e017eb70 |
|       metadata      |                  {}                  |
|     multiattach     |                False                 |
|         name        |             test_volume2             |
|  replication_status |               disabled               |
|         size        |                  10                  |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|       user_id       |   62920a6ecd354e87a691eafa6194d5fb   |
|     volume_type     |              solidfire0              |
+---------------------+--------------------------------------+
  •  Create a volume based on a Glance image in order to boot on the volume. Use cinder create with the option –image-id
$ cinder create 10 --display-name volume_centos6 --image-id a2db0d30-d25e-464d-89e6-785e4b53e032
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
| consistencygroup_id |                 None                 |
|      created_at     |      2016-09-01T15:19:13.000000      |
|     description     |                 None                 |
|      encrypted      |                False                 |
|          id         | b8f56351-d492-48af-8fa0-cdda83138889 |
|       metadata      |                  {}                  |
|     multiattach     |                False                 |
|         name        |            volume_centos6            |
|  replication_status |               disabled               |
|         size        |                  10                  |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|       user_id       |   62920a6ecd354e87a691eafa6194d5fb   |
|     volume_type     |              solidfire0              |
+---------------------+--------------------------------------+
Note:

To obtain the image ID:

$ glance image-list
  • Create a clone from a volume. This is a good way to make a backup of your instances or clone them. Use cinder create with the –source-volid option
$ cinder create 10 --display-name volume_centos6_clone --source-volid b8f56351-d492-48af-8fa0-cdda83138889
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
| consistencygroup_id |                 None                 |
|      created_at     |      2016-09-01T15:25:09.000000      |
|     description     |                 None                 |
|      encrypted      |                False                 |
|          id         | 1685589f-9101-400d-931b-d55eb8c8c449 |
|       metadata      |                  {}                  |
|     multiattach     |                False                 |
|         name        |         volume_centos6_clone         |
|  replication_status |               disabled               |
|         size        |                  10                  |
|     snapshot_id     |                 None                 |
|     source_volid    | b8f56351-d492-48af-8fa0-cdda83138889 |
|        status       |               creating               |
|       user_id       |   62920a6ecd354e87a691eafa6194d5fb   |
|     volume_type     |              solidfire0              |
+---------------------+--------------------------------------+