cinder.volume.flows.manager.manage_existing_snapshot module

class CreateSnapshotOnFinishTask(db, event_suffix, host)

Bases: NotifySnapshotActionTask

Perform final snapshot actions.

When a snapshot is created successfully it is expected that MQ notifications and database updates will occur to ‘signal’ to others that the snapshot 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, snapshot, new_status)

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 ExtractSnapshotRefTask(db)

Bases: CinderTask

Extracts snapshot reference for given snapshot id.

default_provides = 'snapshot_ref'
execute(context, snapshot_id)

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, snapshot_id, 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 the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

class ManageExistingTask(db, driver)

Bases: CinderTask

Brings an existing snapshot under Cinder management.

default_provides = {'new_status', 'snapshot'}
execute(context, snapshot_ref, manage_existing_ref, size)

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 NotifySnapshotActionTask(db, event_suffix, host)

Bases: CinderTask

Performs a notification about the given snapshot when called.

Reversion strategy: N/A

execute(context, snapshot_ref)

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 PrepareForQuotaReservationTask(db, driver)

Bases: CinderTask

Gets the snapshot size from the driver.

default_provides = {'size', 'snapshot_properties'}
execute(context, snapshot_ref, manage_existing_ref)

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 QuotaCommitTask

Bases: 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, snapshot_properties, optional_args)

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 the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

class QuotaReserveTask

Bases: CinderTask

Reserves a single snapshot with the given size.

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 = {'reservations'}
execute(context, size, snapshot_ref, optional_args)

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, optional_args, **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 the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

get_flow(context, db, driver, host, snapshot_id, ref)

Constructs and returns the manager entry point flow.