Creating and using volumes from the command line

Assuming you have an allocation for Jetstream storage, you can create and use volumes from the command line.

To view any volumes you might have:

To create a 10 GB volume, you can do:

Then you can attach it to an instance for use:

While you can usually assume it will be the next mounted disk (root should be /dev/sdaX in all cases on Jetstream), you can look on your instance to see where the volume attached by doing:

The output of that should usually look something like this:

From your instance, you can now create a mount point, view the device, and create the filesystem (using ext4 as the filesystem type for this example).

Assuming you didn't get any errors, /dev/sdb should now be mounted on /vol_b

Note: Linux has a special mount option for file systems called noatime. If this option is set for a file system in /etc/fstab, then reading accesses will no longer cause the atime information (last access time - don't mix this up with the last modified time - if a file is changed, the modification date will still be set) that is associated with a file to be updated (in reverse this means that if noatime is not set, each read access will also result in a write operation). Therefore, using noatime can lead to significant performance gains.

To make the volume mount persist, you can add an entry to /etc/fstab similar to this:

You would need to change as needed for a different device id, mount point, and file system type. We do recommend using the noatime option as shown in the example.

Once you are done with your volume or want to use it with another VM, if you are not shutting down the VM, you'll need to unmount it. 

To detach it from the VM, you'll do:

Doing a openstack volume list now should show the volume as available:

If you want to completely destroy a volume, you can do: