cinder.scheduler.flows.create_volume module

cinder.scheduler.flows.create_volume module

class ExtractSchedulerSpecTask(**kwargs)

Bases: CinderTask

Extracts a spec object from a partial and/or incomplete request spec.

Reversion strategy: N/A

default_provides = {'request_spec'}
execute(context: RequestContext, request_spec: Optional[dict], volume: Volume, snapshot_id: Optional[str], image_id: Optional[str], backup_id: Optional[str]) dict[str, Any]

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 ScheduleCreateVolumeTask(driver_api, **kwargs)

Bases: CinderTask

Activates a scheduler driver and handles any subsequent failures.

Notification strategy: on failure the scheduler rpc notifier will be activated and a notification will be emitted indicating what errored, the reason, and the request (and misc. other data) that caused the error to be triggered.

Reversion strategy: N/A

FAILURE_TOPIC = 'scheduler.create_volume'
execute(context: RequestContext, request_spec: dict, filter_properties: dict, volume: Volume) None

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.

get_flow(context: RequestContext, driver_api, request_spec: Optional[dict] = None, filter_properties: Optional[dict] = None, volume: Optional[Volume] = None, snapshot_id: Optional[str] = None, image_id: Optional[str] = None, backup_id: Optional[str] = None) Engine

Constructs and returns the scheduler entrypoint flow.

This flow will do the following:

  1. Inject keys & values for dependent tasks.

  2. Extract a scheduler specification from the provided inputs.

  3. Use provided scheduler driver to select host and pass volume creation request further.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.