Implement Cinder create volume commands with TaskFlow 0.1.1

Registered by Anastasia Karpinska

TaskFlow should be included to Cinder requirements. Create volume commands from volume.api, volume.manager, scheduler.manager should be implemented with TaskFlow 0.1.1. Old TaskFlow code should be removed from Cinder.

Blueprint information

Status:
Complete
Approver:
John Griffith
Priority:
Medium
Drafter:
Anastasia Karpinska
Direction:
Approved
Assignee:
Anastasia Karpinska
Definition:
Approved
Series goal:
Accepted for icehouse
Implementation:
Implemented
Milestone target:
milestone icon 2014.1
Started by
Anastasia Karpinska
Completed by
John Griffith

Related branches

Sprints

Whiteboard

Currently there are three flows for the create volume command. There are a lot of changes happened in TaskFlow. These changes require a lot of code refactoring of current tasks. What should be done:

1. Add taskflow 0.1.1 package to Cinder requirements, remove old TaskFlow code.

2. Remove cinder/volume/flows/create_volume/__init__.py that contains an implementation of all create_flow commands (api, manager, scheduler). Move these flows to separate files.
    - cinder/volume/flows/create_volume.py
    - cinder/volume/flows/manager_create_volume.py
    - cinder/scheduler/flows/create_volume.py
Tasks that can be used by different flows should be placed into cinder/volume/flows/common.py.

3. Make tasks refactoring: new TaskFlow tasks will have execute() and revert() methods instead of __call__().

4. Next changes that happened in TaskFlow 0.1.1 should be taken into account:
    - TaskFlow holds all data used and returned by tasks in storage. Storage holds constant data that cannot be changed by tasks.
    - All exceptions that have been thrown by tasks are stored in TaskFlow. If exception have been raised during the revert, the flow stops the revert and re-raise this exception. Flow is marked as failed.

5. Volume manager create volume flow can't be split by tasks because of different behavior that depends on parameters. This command should be implemented as 4 different flows to create volume from snapshot, source volume, image. This will reduce an amount of flow parameters and branches.

Gerrit topic: https://review.openstack.org/#q,topic:bp/create-volume-flow,n,z

Addressed by: https://review.openstack.org/58724
    Switch create volume commands to Taskflow 0.1.1

Addressed by: https://review.openstack.org/62671
    Create structure of flows' pakages

Addressed by: https://review.openstack.org/66283
    Rename __init__.py to create_volume.py

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.