Configuring volume types

Volume types in Cinder are a label or identifier that is selected during volume creation. Typically, volume types correspond with some attribute of the volumes, for example, SSD, High IOPS, and Encrypted. We will use this with the next recipe to define further features of our Cinder service.

Getting ready

To create a volume type, you will need the following:

  • An openrc file with appropriate credentials for the environment (you must be an administrator)
  • The openstack command-line client
  • The name of the volume type to create. For our example, we will create the "High IOPS" volume type as a contrived example type that would refer to a block storage device dedicated to High IOPS.

How to do it…

We will use the openstack volume type command to operate on Cinder volume types. To create a volume type, use the following steps:

  1. First, list the existing volume types:
    openstack volume type list
    

    This will bring back an output like the following. Here we have the default set when we installed our LVM service:

    How to do it…
  2. Create the new volume type:
    openstack volume type create
        --description "The High IOPS volume type is QOS applied to 500 IOPS"
        "High IOPS"
    

    This will bring back an output like the following:

    How to do it…
  3. Confirm that the new volume type is available by displaying the list of volume types:
    openstack volume type list
    

    This will now bring back our additional volume type:

    How to do it…
  4. To use this new type when creating a volume, we will use the --type flag as follows:
    openstack volume create
        --size 10
        --type "High IOPS"
        --description "High IOPS Volume"
        highiops.volume
    
  5. We will verify the type in the output:
    How to do it…

How it works…

The openstack volume type create command has only one mandatory parameter, name. The name parameter allows users to define different volume types or identifiers. While typically based on some attribute of the storage, such as department, storage backend, or QOS level, as these are labels, as long as they're well understood, the name can be arbitrary.

Additionally, the --description flag can be used to provide more detail on the volume type. The --private flag allows you to restrict visibility from the public. The --project flag allows the selective sharing of a private volume type with other named projects.

We will then take advantage of these types (with further configuration of Cinder to specify that a type of storage, which is associated with a particular volume type) by issuing the --type flag to the volume create command:

openstack volume create
    --size size_GiB
    --description "meaningful description"
    --type "Type"
    volume_name
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.5.166