cinder.volume.flows.manager.create_volume module¶
- class CreateVolumeFromSpecTask(manager, db, driver, image_volume_cache=None)¶
Bases:
CinderTask
Creates a volume from a provided specification.
Reversion strategy: N/A
- default_provides = 'volume_spec'¶
- execute(context: RequestContext, volume: Volume, volume_spec) dict ¶
Activate a given atom which will perform some operation and return.
This method can be used to perform an action on a given set of input requirements (passed in via
*args
and**kwargs
) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).
- Parameters:
args – positional arguments that atom requires to execute.
kwargs – any keyword arguments that atom requires to execute.
- property message¶
- class CreateVolumeOnFinishTask(db, event_suffix)¶
Bases:
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)¶
Activate a given atom which will perform some operation and return.
This method can be used to perform an action on a given set of input requirements (passed in via
*args
and**kwargs
) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).
- Parameters:
args – positional arguments that atom requires to execute.
kwargs – any keyword arguments that atom requires to execute.
- class ExtractVolumeRefTask(db, host, set_error=True)¶
Bases:
CinderTask
Extracts volume reference for given volume id.
- default_provides = 'refreshed'¶
- execute(context, volume)¶
Activate a given atom which will perform some operation and return.
This method can be used to perform an action on a given set of input requirements (passed in via
*args
and**kwargs
) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).
- Parameters:
args – positional arguments that atom requires to execute.
kwargs – any keyword arguments that atom requires to execute.
- revert(context, volume, result, **kwargs)¶
Revert this atom.
This method should undo any side-effects caused by previous execution of the atom using the result of the
execute()
method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).- Parameters:
args – positional arguments that the atom required to execute.
kwargs – any keyword arguments that the atom required to execute; the special key
'result'
will contain theexecute()
result (if any) and the**kwargs
key'flow_failures'
will contain any failure information.
- class ExtractVolumeSpecTask(db)¶
Bases:
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)¶
Activate a given atom which will perform some operation and return.
This method can be used to perform an action on a given set of input requirements (passed in via
*args
and**kwargs
) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).
- Parameters:
args – positional arguments that atom requires to execute.
kwargs – any keyword arguments that atom requires to execute.
- revert(context, result, **kwargs)¶
Revert this atom.
This method should undo any side-effects caused by previous execution of the atom using the result of the
execute()
method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).- Parameters:
args – positional arguments that the atom required to execute.
kwargs – any keyword arguments that the atom required to execute; the special key
'result'
will contain theexecute()
result (if any) and the**kwargs
key'flow_failures'
will contain any failure information.
- class NotifyVolumeActionTask(db, event_suffix)¶
Bases:
CinderTask
Performs a notification about the given volume when called.
Reversion strategy: N/A
- execute(context, volume)¶
Activate a given atom which will perform some operation and return.
This method can be used to perform an action on a given set of input requirements (passed in via
*args
and**kwargs
) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).
- Parameters:
args – positional arguments that atom requires to execute.
kwargs – any keyword arguments that atom requires to execute.
- class OnFailureRescheduleTask(reschedule_context, db, manager, scheduler_rpcapi, do_reschedule)¶
Bases:
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)¶
Activate a given atom which will perform some operation and return.
This method can be used to perform an action on a given set of input requirements (passed in via
*args
and**kwargs
) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).
- Parameters:
args – positional arguments that atom requires to execute.
kwargs – any keyword arguments that atom requires to execute.
- revert(context, result, flow_failures, volume, **kwargs)¶
Revert this atom.
This method should undo any side-effects caused by previous execution of the atom using the result of the
execute()
method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).- Parameters:
args – positional arguments that the atom required to execute.
kwargs – any keyword arguments that the atom required to execute; the special key
'result'
will contain theexecute()
result (if any) and the**kwargs
key'flow_failures'
will contain any failure information.
- 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 an on-success only task that notifies that the volume creation has ended and performs further database status updates.