cinder.volume.volume_types module

Built-in volume type properties.

add_volume_type_access(context, volume_type_id, project_id)

Add access to volume type for project_id.

create(context, name, extra_specs=None, is_public=True, projects=None, description=None)

Creates volume types.

destroy(context, id)

Marks volume types as deleted.

There must exist at least one volume type (i.e. the default type) in the deployment. This method achieves that by ensuring: 1) the default_volume_type is set and is a valid one 2) the type requested to delete isn’t the default type

Raises

VolumeTypeDefaultDeletionError – when the type requested to delete is the default type

get_all_types(context, inactive=0, filters=None, marker=None, limit=None, sort_keys=None, sort_dirs=None, offset=None, list_result=False)

Get all non-deleted volume_types.

Pass true as argument if you want deleted volume types returned also.

get_all_types_by_group(context, group_id)

Get all volume_types in a group.

get_by_name_or_id(context, identity)

Retrieves volume type by id or name

get_default_volume_type(contxt=None)

Get the default volume type.

Raises

VolumeTypeDefaultMisconfiguredError – when the configured default is not found

get_volume_type(ctxt, id, expected_fields=None)

Retrieves single volume type by id.

get_volume_type_by_name(context, name)

Retrieves single volume type by name.

get_volume_type_encryption(context, volume_type_id)
get_volume_type_extra_specs(volume_type_id, key=False)
get_volume_type_qos_specs(volume_type_id)

Get all qos specs for given volume type.

is_encrypted(context, volume_type_id)
is_public_volume_type(context, volume_type_id)

Return is_public boolean value of volume type

notify_about_volume_type_access_usage(context, volume_type_id, project_id, event_suffix, host=None)

Notify about successful usage type-access-(add/remove) command.

Parameters
  • context – security context

  • volume_type_id – volume type uuid

  • project_id – tenant uuid

  • event_suffix – name of called operation access-(add/remove)

  • host – hostname

provision_filter_on_size(context, volume_type, size)

This function filters volume provisioning requests on size limits.

If a volume type has provisioning size min/max set, this filter will ensure that the volume size requested is within the size limits specified in the volume type.

remove_volume_type_access(context, volume_type_id, project_id)

Remove access to volume type for project_id.

update(context, id, name, description, is_public=None)

Update volume type by id.

volume_types_diff(context: cinder.context.RequestContext, vol_type_id1, vol_type_id2)Tuple[dict, bool]

Returns a ‘diff’ of two volume types and whether they are equal.

Returns a tuple of (diff, equal), where ‘equal’ is a boolean indicating whether there is any difference, and ‘diff’ is a dictionary with the following format:

{
    'extra_specs': {'key1': (value_in_1st_vol_type,
                             value_in_2nd_vol_type),
                    'key2': (value_in_1st_vol_type,
                             value_in_2nd_vol_type),
                    {...}}
    'qos_specs': {'key1': (value_in_1st_vol_type,
                           value_in_2nd_vol_type),
                  'key2': (value_in_1st_vol_type,
                           value_in_2nd_vol_type),
                  {...}}
    'encryption': {'cipher': (value_in_1st_vol_type,
                              value_in_2nd_vol_type),
                  {'key_size': (value_in_1st_vol_type,
                                value_in_2nd_vol_type),
                   {...}}
}
volume_types_encryption_changed(context, vol_type_id1, vol_type_id2)

Return whether encryptions of two volume types are same.