Ability to create multiple volumes at the same time

Registered by Sébastien Han

The goal of the blueprint is to allow the creation of more volumes at the same time (of sequentially) from the cinder create command. The idea is the same as nova, thus a new option (new parameter of 'create') should be added like so:

$ cinder create --num-volumes 3 --display-name volume <size>

e.g.

$cinder create --num-volumes 2 --display-name testvolume 1

+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2014-01-23T16:31:48.267289 |
| description | None |
| id | 78234f50-cdd1-4eb1-a4cb-51fdd62655b0 |
| metadata | {} |
| name | testvolume-1 |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| user_id | c1d40fde5dbf4c11ada67cae1f009833 |
| volume_type | None |
+-------------------+--------------------------------------+

+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2014-01-23T16:31:48.267289 |
| description | None |
| id | 88445533-cdd1-4eb1-a4cb-51fdd62655b0 |
| metadata | {} |
| name | testvolume-2 |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| user_id | c1d40fde5dbf4c11ada67cae1f009833 |
| volume_type | None |
+-------------------+--------------------------------------+

$ cinder create --num-volumes 2 1
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2014-01-23T16:31:48.267289 |
| description | None |
| id | 78234f50-cdd1-4eb1-a4cb-51fdd62655b0 |
| metadata | {} |
| name | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| user_id | c1d40fde5dbf4c11ada67cae1f009833 |
| volume_type | None |
+-------------------+--------------------------------------+

+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2014-01-23T16:31:48.267289 |
| description | None |
| id | 88445533-cdd1-4eb1-a4cb-51fdd62655b0 |
| metadata | {} |
| name | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| user_id | c1d40fde5dbf4c11ada67cae1f009833 |
| volume_type | None |
+-------------------+--------------------------------------+

Additional formatting parameter added in the cinderclient --summarize which will display the condensed output for multiple volume creation.

e.g.

$ cinder create --num-volumes 2 --summarize true --display-name test2 1
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| 78234f50-cdd1-4eb1-a4cb-51fdd62655b0 | available | test2-1 | 1 | None | false | |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
| 88776644-cdd1-4eb1-a4cb-51fdd62655b0 | available | test2-2 | 1 | None | false | |
+--------------------------------------+-----------+------+------+-------------+----------+-------------+

This will also need additional input parameters on dashboard for number of volumes.

Blueprint information

Status:
Complete
Approver:
John Griffith
Priority:
Undefined
Drafter:
Sébastien Han
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Good progress
Milestone target:
None
Started by
Swapnil Kulkarni
Completed by
Sean McGinnis

Related branches

Sprints

Whiteboard

Currently Understood User Stories are

1. As a Openstack End User I want to create multiple volumes at the same time using OpenStack CLI & REST interface.
2. As a Openstack End User I want to create multiple volumes at the same time using OpenStack Dashboard.

Duncan, I updated the cinderclient code for creating multiple volumes, but If i do the changes only in cinderclient, for every other client using cinder client will need similar changes? Since I did the changes on cinderclient, did the changes on dashboard to accept the number of volumes, but with similar changes I cannot create multiple volumes from dashboard. I need to update the dashboard api to include the additional input parameters still it does not understand its a multiple volume request and creates only one volume.

Gerrit topic: https://review.openstack.org/#q,topic:bp/create-multiple-volume-from-cli,n,z

cinderclient changeset : https://review.openstack.org/#/c/64646/
horizon changeset : https://review.openstack.org/#/c/64652/ (WIP)

Every client needs to change whether you do this client or server side. I struggle to envisage a client for which a for loop is a significant issue.

I have never looked that the dashboard code TBH, but I imagine it will need work to support multiple volumes and to sensibly display the result. The nova thing of only displaying the last instance created is a bit poor IMO

DuncanT- I code changes have been updated as per discussion in IRC

Addressed by: https://review.openstack.org/64646
    Ability to create multiple volumes from cli

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.