The cinder.volume.flows.manager.create_volume Module

class CreateVolumeFromSpecTask(manager, db, driver, image_volume_cache=None)

Bases: cinder.flow_utils.CinderTask

Creates a volume from a provided specification.

Reversion strategy: N/A

default_provides = 'volume'
execute(context, volume_ref, volume_spec)
class CreateVolumeOnFinishTask(db, event_suffix)

Bases: cinder.volume.flows.manager.create_volume.NotifyVolumeActionTask

On successful volume creation this will perform final volume actions.

When a volume is created successfully it is expected that MQ notifications and database updates will occur to ‘signal’ to others that the volume is now ready for usage. This task does those notifications and updates in a reliable manner (not re-raising exceptions if said actions can not be triggered).

Reversion strategy: N/A

execute(context, volume, volume_spec)
class ExtractVolumeRefTask(db, host, set_error=True)

Bases: cinder.flow_utils.CinderTask

Extracts volume reference for given volume id.

default_provides = 'volume_ref'
execute(context, volume_id)
revert(context, volume_id, result, **kwargs)
class ExtractVolumeSpecTask(db)

Bases: cinder.flow_utils.CinderTask

Extracts a spec of a volume to be created into a common structure.

This task extracts and organizes the input requirements into a common and easier to analyze structure for later tasks to use. It will also attach the underlying database volume reference which can be used by other tasks to reference for further details about the volume to be.

Reversion strategy: N/A

default_provides = 'volume_spec'
execute(context, volume_ref, request_spec)
revert(context, result, **kwargs)
class NotifyVolumeActionTask(db, event_suffix)

Bases: cinder.flow_utils.CinderTask

Performs a notification about the given volume when called.

Reversion strategy: N/A

execute(context, volume_ref)
class OnFailureRescheduleTask(reschedule_context, db, scheduler_rpcapi, do_reschedule)

Bases: cinder.flow_utils.CinderTask

Triggers a rescheduling request to be sent when reverting occurs.

If rescheduling doesn’t occur this task errors out the volume.

Reversion strategy: Triggers the rescheduling mechanism whereby a cast gets sent to the scheduler rpc api to allow for an attempt X of Y for scheduling this volume elsewhere.

execute(**kwargs)
revert(context, result, flow_failures, volume_ref, **kwargs)
get_flow(context, manager, db, driver, scheduler_rpcapi, host, volume_id, allow_reschedule, reschedule_context, request_spec, filter_properties, image_volume_cache=None)

Constructs and returns the manager entrypoint flow.

This flow will do the following:

  1. Determines if rescheduling is enabled (ahead of time).
  2. Inject keys & values for dependent tasks.
  3. Selects 1 of 2 activated only on failure tasks (one to update the db status & notify or one to update the db status & notify & reschedule).
  4. Extracts a volume specification from the provided inputs.
  5. Notifies that the volume has started to be created.
  6. Creates a volume from the extracted volume specification.
  7. Attaches a on-success only task that notifies that the volume creation has ended and performs further database status updates.

Previous topic

The cinder.volume.flows.common Module

Next topic

The cinder.volume.flows.manager.manage_existing Module

Project Source

This Page