Add clone_volume functionality to Cinder

Registered by John Griffith

Add the ability to call clone_volume to Cinder that will result in a new volume object ready to be attached and used and of course is a "clone" of the originating volume.

Current implementation is an additional option to volume_create. This looks like:
'cinder create --src-volume xxxxx 10'

The process for the base LVM cas is:
1. cinder.volume.api calls create on the same host as the existing/src volume
2. cinder.volume.manager.create calls driver.create_cloned_volume()
3. cinder.volume.driver.create_cloned_volume
    a. Creates a temporary snapshot of the src volume (so we don't require detach)
    b. uses copy to volume from snapshot same as we do for create_volume_from_snapshot
    c. deletes the temporary snapshot

Initially would be implemented to work only across common storage types (LVM, Ceph etc), with the potential of being expanded in the future.

In addition another blueprint should be submitted to add to snapshot capabilities. This would add a method like: "volume_revert(volume, snapshot_id)", that would restore a volume to it's state when provided snapshot was taken.

Blueprint information

Status:
Complete
Approver:
John Griffith
Priority:
High
Drafter:
John Griffith
Direction:
Approved
Assignee:
John Griffith
Definition:
Approved
Series goal:
Accepted for grizzly
Implementation:
Implemented
Milestone target:
milestone icon 2013.1
Started by
John Griffith
Completed by
Thierry Carrez

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/add-cloning-support-to-cinder,n,z

Addressed by: https://review.openstack.org/17979
    Implement ability to Clone volumes in Cinder.

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

Addressed by: https://review.openstack.org/19189
    NetApp direct to filer drivers for iscsi and nfs.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.