3.2. Creating and configuring a volume type


You can create volume types so that you can apply associated settings to each volume type. For instance, you can create volume types to provide different levels of performance for your cloud users.

After creating a volume type, you can associate it with a Quality of Service specification that further configures volume performance. For more information, see Customizing Block Storage service (cinder) QoS specifications.

Considerations
  • Volume type visibility: By default, all volume types are public and accessible to all projects. If you need to create volume types with restricted access, create a private volume type. For more information, see Creating and using private volume types.
  • Deployment strategies: For smaller deployments that have a limited number of back ends, you can create volume types that target each back end by using the volume_backend_name property. In this case, volumes that use these volume types are scheduled on the specified back ends. For more information, see the example provided by Editing a volume type.

    For large deployments with large numbers of back ends, this strategy may not be viable. In this case, it is better that the Block Storage scheduler determines the best back end for a volume, based on the configured scheduler filters.

Prerequisites

  • You must be a project administrator to create and configure volume types.
  • Know the names of the keys and their required values for the back-end driver capabilities that you want to add to your volume types. For more information, see Listing back-end driver capabilities.

Procedure

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
  2. Create and configure a volume type.

    $ openstack volume type create --property <key>=<value> <volume_type_name>

    Add the required properties to the volume type, by specifying a separate --property <key>=<value> argument, as follows:

    • Replace <key> with the property key. Ensure that you spell the key correctly. Any incorrectly spelled keys are added but will not work.
    • Replace <value> with the required value of the <key>.
    • Replace <volume_type_name> with the name of your volume type.

      For example:

      $ openstack volume type create \
      --property thin_provisioning=true \
      --property compression=false \
      MyVolumeType
      +-------------+-----------------------------------------------+
      | Field       | Value                                         |
      +-------------+-----------------------------------------------+
      | description | None                                          |
      | id          | c244205c-fb22-4076-9780-edebe55889bc          |
      | is_public   | True                                          |
      | name        | MyVolumeType                                  |
      | properties  | compression='false', thin_provisioning='true' |
      +-------------+-----------------------------------------------+
  3. Exit the openstackclient pod:

    $ exit

3.2.1. Creating and using private volume types

By default, all volume types are public and available to all projects (tenants). To control or to limit the access to a volume type, you can create a private volume type.

注意

By default, private volume types are only accessible to their creators. But all administrative users can view private volume types.

Private volume types restrict access to volumes with certain attributes. Typically, these are settings that should only be usable by specific projects. For instance, new back ends or ultra-high performance configurations that are being tested.

Prerequisites

  • You must be a project administrator to create and configure volume types.

Procedure

  1. Access the remote shell for the openstackclient pod from your workstation:

    $ oc rsh -n openstack openstackclient
  2. Create a new private volume type.

    $ openstack volume type create --private <volume_type_name>
    • Replace <volume_type_name> with the name for the new private volume type.

      You can confirm that this is a private volume because the is_public field is set to False. For example:

      $ openstack volume type create --private MyVolType2
      +-------------+--------------------------------------+
      | Field       | Value                                |
      +-------------+--------------------------------------+
      | description | None                                 |
      | id          | 20659377-935d-4253-8b82-ae12c4710288 |
      | is_public   | False                                |
      | name        | MyVolType2                           |
      +-------------+--------------------------------------+
  3. Optional: View private and public volume types.

    $ openstack volume type list

    This provides a table of the volume types and the Is Public column indicates whether a volume type is private (False) or public (True). For example:

    +--------------------------------------+-------------+-----------+
    | ID                                   | Name        | Is Public |
    +--------------------------------------+-------------+-----------+
    | 271f9b90-8186-4143-aaed-09e91820d852 | MyVolType3  | True      |
    | 20659377-935d-4253-8b82-ae12c4710288 | MyVolType2  | False     |
    | 28b5ca7f-0eb0-43ce-bf0a-898fab92d43b | MyVolType1  | True      |
    | 0875116b-27d6-493c-aca6-f62de4d58614 | __DEFAULT__ | True      |
    +--------------------------------------+-------------+-----------+

    This table also provides the name and ID of both public and private volume types, because you need the ID of the volume type to provide access to it.

  4. Optional: List the projects to obtain the ID of the required project:

    $ openstack project list
  5. (Optional) Allow a project to access a private volume type:

    $ openstack volume type set <type_id> --project <project_id>
    • Replace <type_id> with the ID of the required private volume type.
    • Replace <project_id> with the ID of the project that should access this private volume type.

      注意

      Access to a private volume type is granted at the project level. If you only know the name of a user of this project, then run the openstack user list command, which lists the name and tenant ID of all the configured users.

  6. (Optional) View which projects have access to a private volume type:

    $ openstack volume type show <type_id>

    The access_project_ids field of the resultant table provides the IDs of all the projects that can access this private volume type.

  7. (Optional) Remove project access from a private volume type:

    $ openstack volume type unset <type_id> --project <project_id>

    You can confirm this by running openstack volume type show <type_id> and ensuring this project is not specified in the access_project_ids field.

  8. Exit the openstackclient pod:

    $ exit
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部