The cinder.volume.flows.api.create_volume Module

class EntryCreateTask(db)

Bases: cinder.flow_utils.CinderTask

Creates an entry for the given volume creation in the database.

Reversion strategy: remove the volume_id created from the database.

default_provides = set(['volume', 'volume_properties', 'volume_id'])
execute(context, optional_args, **kwargs)

Creates a database entry for the given inputs and returns details.

Accesses the database and creates a new entry for the to be created volume using the given volume properties which are extracted from the input kwargs (and associated requirements this task needs). These requirements should be previously satisfied and validated by a pre-cursor task.

revert(context, result, optional_args, **kwargs)
class ExtractVolumeRequestTask(image_service, availability_zones, **kwargs)

Bases: cinder.flow_utils.CinderTask

Processes an api request values into a validated set of values.

This tasks responsibility is to take in a set of inputs that will form a potential volume request and validates those values against a set of conditions and/or translates those values into a valid set and then returns the validated/translated values for use by other tasks.

Reversion strategy: N/A

default_provides = set(['volume_type_id', 'availability_zone', 'source_replicaid', 'volume_type', 'cgsnapshot_id', 'qos_specs', 'encryption_key_id', 'source_volid', 'snapshot_id', 'consistencygroup_id', 'group_id', 'size'])
execute(context, size, snapshot, image_id, source_volume, availability_zone, volume_type, metadata, key_manager, source_replica, consistencygroup, cgsnapshot, group)
class QuotaCommitTask

Bases: cinder.flow_utils.CinderTask

Commits the reservation.

Reversion strategy: N/A (the rollback will be handled by the task that did the initial reservation (see: QuotaReserveTask).

Warning Warning: if the process that is running this reserve and commit process fails (or is killed before the quota is rolled back or committed it does appear like the quota will never be rolled back). This makes software upgrades hard (inflight operations will need to be stopped or allowed to complete before the upgrade can occur). In the future when taskflow has persistence built-in this should be easier to correct via an automated or manual process.

execute(context, reservations, volume_properties, optional_args)
revert(context, result, **kwargs)
class QuotaReserveTask

Bases: cinder.flow_utils.CinderTask

Reserves a single volume with the given size & the given volume type.

Reversion strategy: rollback the quota reservation.

Warning Warning: if the process that is running this reserve and commit process fails (or is killed before the quota is rolled back or committed it does appear like the quota will never be rolled back). This makes software upgrades hard (inflight operations will need to be stopped or allowed to complete before the upgrade can occur). In the future when taskflow has persistence built-in this should be easier to correct via an automated or manual process.

default_provides = set(['reservations'])
execute(context, size, volume_type_id, optional_args)
revert(context, result, optional_args, **kwargs)
class VolumeCastTask(scheduler_rpcapi, volume_rpcapi, db)

Bases: cinder.flow_utils.CinderTask

Performs a volume create cast to the scheduler or to the volume manager.

This will signal a transition of the api workflow to another child and/or related workflow on another component.

Reversion strategy: rollback source volume status and error out newly created volume.

execute(context, **kwargs)
revert(context, result, flow_failures, volume, **kwargs)
get_flow(db_api, image_service_api, availability_zones, create_what, scheduler_rpcapi=None, volume_rpcapi=None)

Constructs and returns the api entrypoint flow.

This flow will do the following:

  1. Inject keys & values for dependent tasks.
  2. Extracts and validates the input keys & values.
  3. Reserves the quota (reverts quota on any failures).
  4. Creates the database entry.
  5. Commits the quota.
  6. Casts to volume manager or scheduler for further processing.

Previous topic

The cinder.volume.drivers.zte.zte_pub Module

Next topic

The cinder.volume.flows.api.manage_existing Module

This Page