3.2.4. Configuring project-specific default volume types
If you create a volume and do not specify a volume type, the Block Storage service (cinder) uses the default volume type. You can use the default_volume_type parameter, when initially configuring the Block Storage service, to define the general default volume type that applies to all projects. By default, this volume type is called __DEFAULT__. For more information, see Configuring initial Block Storage service defaults in Configuring persistent storage.
If your deployment uses project-specific volume types, ensure that you define default volume types for each project. In this case, Block Storage uses the project-specific volume type instead of the general default volume type. The following deployment types need project-specific default volume types:
- A distributed deployment spanning many availability zones (AZs). Each AZ is in its own project and has its own volume types.
- A multi-department, corporate deployment. Each department is in its own project and has its own specialized volume type.
Prerequisites
- At least one volume type in each project that will be the project-specific default volume type. For more information, see Creating and configuring a volume type.
- Block Storage REST API microversion 3.62 or later.
- Only project administrators can define, clear, or list default volume types for their projects.
Procedure
Access the remote shell for the
openstackclientpod from your workstation:$ oc rsh -n openstack openstackclient $ source ./cloudrcConfigure the default volume type for a project:
$ cinder --os-volume-api-version 3.62 default-type-set <volume_type> <project_id>-
Replace
<volume_type>with the name or ID of the required volume type. To find the volume type name and ID, use thevolume type listcommand. -
Replace
<project_id>with the ID of the appropriate project. To find the project ID, use theopenstack project listcommand.
-
Replace
(Optional) Remove a default volume type for a project:
$ cinder --os-volume-api-version 3.62 default-type-unset <project_id>-
Replace
<project_id>with the ID of the appropriate project. To find the project ID, use theopenstack project listcommand.
-
Replace
(Optional) List the default volume type for a project:
$ cinder --os-volume-api-version 3.62 default-type-list --project <project_id>-
Replace
<project_id>with the ID of the appropriate project. To find the project ID, use theopenstack project listcommand.
-
Replace
Exit the
openstackclientpod:$ exit