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
-
execute
(context, volume, 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
= ‘refreshed’¶
-
execute
(context, volume)¶
-
revert
(context, volume, 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, 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)¶
-
-
class
OnFailureRescheduleTask
(reschedule_context, db, driver, 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, **kwargs)¶
-
-
get_flow
(context, manager, db, driver, scheduler_rpcapi, host, volume, 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:
- Determines if rescheduling is enabled (ahead of time).
- Inject keys & values for dependent tasks.
- 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).
- Extracts a volume specification from the provided inputs.
- Notifies that the volume has started to be created.
- Creates a volume from the extracted volume specification.
- Attaches a on-success only task that notifies that the volume creation has ended and performs further database status updates.