The cinder.objects.volume Module

class MetadataObject(key=None, value=None)

Bases: dict

class Volume(*args, **kwargs)

Bases: cinder.objects.base.CinderPersistentObject, cinder.objects.base.CinderObject, cinder.objects.base.CinderObjectDictCompat, cinder.objects.base.CinderComparableObject, cinder.objects.base.ClusteredObject

OPTIONAL_FIELDS = ('metadata', 'admin_metadata', 'glance_metadata', 'volume_type', 'volume_attachment', 'consistencygroup', 'snapshots', 'cluster', 'group')
VERSION = '1.5'
admin_metadata
attach_status
availability_zone
bootable
cluster
cluster_name
consistencygroup
consistencygroup_id
create()
created_at
delete_metadata_key(key)
deleted
deleted_at
destroy()
display_description
display_name
ec2_id
encryption_key_id
fields = {'migration_status': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'provider_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'availability_zone': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'terminated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'snapshots': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'provider_geometry': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'cluster': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'replication_status': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'snapshot_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'ec2_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'size': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'group': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume_attachment': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'display_description': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'cluster_name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'project_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'launched_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'scheduled_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'status': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume_type_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'replication_extended_status': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'multiattach': Boolean(default=False,nullable=True), 'deleted': Boolean(default=False,nullable=True), 'attach_status': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'provider_location': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'admin_metadata': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'host': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'glance_metadata': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'consistencygroup_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'source_volid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'provider_auth': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'previous_status': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'display_name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'user_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'bootable': Boolean(default=False,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'metadata': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume_type': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'consistencygroup': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), '_name_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'encryption_key_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'replication_driver_data': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'group_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}
finish_volume_migration(dest_volume)
glance_metadata
group
group_id
host
id
launched_at
metadata
migration_status
model

alias of Volume

multiattach
name
name_id
obj_extra_fields = ['name', 'name_id', 'volume_metadata', 'volume_admin_metadata', 'volume_glance_metadata']
obj_load_attr(attrname)
obj_make_compatible(primitive, target_version)

Make a Volume representation compatible with a target version.

obj_reset_changes(fields=None)
obj_what_changed()
previous_status
project_id
provider_auth
provider_geometry
provider_id
provider_location
replication_driver_data
replication_extended_status
replication_status
save()
scheduled_at
size
snapshot_id
snapshots
source_volid
status
terminated_at
updated_at
user_id
volume_admin_metadata
volume_attachment
volume_glance_metadata
volume_metadata
volume_type
volume_type_id
class VolumeList(*args, **kwargs)

Bases: cinder.objects.base.ObjectListBase, cinder.objects.base.CinderObject

VERSION = '1.1'
fields = {'objects': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
classmethod get_all(context, marker, limit, sort_keys=None, sort_dirs=None, filters=None, offset=None)
classmethod get_all_by_generic_group(context, group_id, filters=None)
classmethod get_all_by_group(context, group_id, filters=None)
classmethod get_all_by_host(context, host, filters=None)
classmethod get_all_by_project(context, project_id, marker, limit, sort_keys=None, sort_dirs=None, filters=None, offset=None)
classmethod get_volume_summary_all(context)
classmethod get_volume_summary_by_project(context, project_id)
static include_in_cluster(context, cluster, partial_rename=True, **filters)

Include all volumes matching the filters into a cluster.

When partial_rename is set we will not set the cluster_name with cluster parameter value directly, we’ll replace provided cluster_name or host filter value with cluster instead.

This is useful when we want to replace just the cluster name but leave the backend and pool information as it is. If we are using cluster_name to filter, we’ll use that same DB field to replace the cluster value and leave the rest as it is. Likewise if we use the host to filter.

Returns the number of volumes that have been changed.

objects

Previous topic

The cinder.objects.snapshot Module

Next topic

The cinder.objects.volume_attachment Module

This Page