Efficient volume copy for volume migration

Registered by Mitsuhiro Tanino

Currently, cinder supports these 3ways for volume migration.
- Cinder storage driver
- Cinder volume manager
- Nova compute

During Cinder assisted volume migration, Cinder uses dd command for
data copy of volume migration, but the copy always copy full blocks
even if the source data contains many null and zero blocks.
The dd command has an option conv=sparse to skip null or zero blocks
for more efficient data copy.

The purpose of this bluprint is introduce a mechanism to handle sparse
copy option properly into Cinder assisted volume migration.

If the volume pre-initilization(zero cleared) is ensured beforehand at
the destination c-vol, we can skip copy of null and zero blocks to
destination volume by using sparse copy.

However, if the destination volume is not zero cleared beforehand,
we have to copy full block from source to dest volume to cleanup
unused region of dest volume in order to avoid data corruption problem.

For example, following case, we should copy full block because
new volume of thick LVM might not be initialized, we must not
use conv=sparse option for similar cases.

  - Source c-vol driver: Thin LVM
  - Dest c-vol driver: Drivers who provides an uninitialized new volume.(ex. Thick LVM)

In order to handle sparse option properly,
(1) Add sparse_volume_copy capability into capabilities list as an well-defined option.
(2) Get capability list before starting volume copy using get_capabilities method.

Steps of migrate_volume
source c-vol driver              dest c-vol driver
  |                               |
  | Ask capability of sparse_copy_volume via  |
  | get_capabilities                   |
  | Dest c-vol returns capabilities to source c-vol |
  |                               |
  | Start volume copy with or without sparse   |
  | based on the retun from dest c-vol       |

Blueprint information

Mike Perez
Mitsuhiro Tanino
Mitsuhiro Tanino
Series goal:
Accepted for liberty
Milestone target:
milestone icon 7.0.0
Started by
Mitsuhiro Tanino
Completed by
Mitsuhiro Tanino

Related branches



Gerrit topic: https://review.openstack.org/#q,topic:bp/host-attach,n,z

Addressed by: https://review.openstack.org/186209/
    Efficient volume copy for volume migration

Addressed by: https://review.openstack.org/183701/
    Efficient volume copy for cinder assisted migration

Gerrit topic: https://review.openstack.org/#q,topic:bp/efficient-volume-copy-for-cinder-assisted-migration,n,z

Addressed by: https://review.openstack.org/201243
    Adds framework for get_capabilities() feature


Work Items

This blueprint contains Public information 
Everyone can see this information.