Creating volumes
Now that we have created a Cinder volume service, we can now create volumes for use by our instances. We do this under our client environment using the Python-OpenStack client with the python-cinderclient
library; so we are creating volumes specific to our project (tenant).
Note
Refer to Chapter 2, The OpenStack Client, for more information on installing and configuring the OpenStack client.
Getting ready
To create a volume, the following is required:
The
openstack
command line clientAn
openrc
file with appropriate credentials for the environmentThe desired name for the volume
The desired size in GiB for the volume
For our example, these are the following:
Volume name:
cookbook.volume
Size: 10 GiB
How to do it...
Carry out the following steps to create a volume:
We simply create the volume that we will attach to our instance with the following command:
openstack volume create --size 10 --description "Cookbook Volume" cookbook.volume
On completion, the command returns the...