]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Consistency Groups
authorXing Yang <xing.yang@emc.com>
Wed, 27 Aug 2014 03:53:34 +0000 (23:53 -0400)
committerXing Yang <xing.yang@emc.com>
Wed, 27 Aug 2014 05:47:31 +0000 (01:47 -0400)
commitcf961f83ac323dfad1fa5e227d1e502a17529ecc
tree7cc976b3bb9e3718be26353d92e03de27e7118fe
parent9bddf33f9fbacfa4b02f878786f49d6972113b8c
Consistency Groups

This patch enables Consistency Groups support in Cinder.
It will be implemented for snapshots for CGs in phase 1.

Design
------------------------------------------------
The workflow is as follows:

1) Create a CG, specifying all volume types that can be supported by this
CG. The scheduler chooses a backend that supports all specified volume types.
The CG will be empty when it is first created.   Backend needs to report
consistencygroup_support = True.  Volume type can have the following in
extra specs: {'capabilities:consistencygroup_support': '<is> True'}.
If consistencygroup_support is not in volume type extra specs, it will be
added to filter_properties by the scheduler to make sure that the scheduler
will select the backend which reports consistency group support capability.

Create CG CLI:
cinder consisgroup-create --volume-type type1,type2 mycg1

This will add a CG entry in the new consistencygroups table.

2) After the CG is created, create a new volume and add to the CG.
Repeat until all volumes are created for the CG.

Create volume CLI (with CG):
cinder create --volume-type type1 --consisgroup-id <CG uuid> 10

This will add a consistencygroup_id foreign key in the new volume
entry in the db.

3) Create a snapshot of the CG (cgsnapshot).

Create cgsnapshot CLI:
cinder cgsnapshot-create <CG uuid>

This will add a cgsnapshot entry in the new cgsnapshots table, create
snapshot for each volume in the CG, and add a cgsnapshot_id foreign key
in each newly created snapshot entry in the db.

DocImpact
Implements: blueprint consistency-groups

Change-Id: Ic105698aaad86ee30ef57ecf5107c224fdadf724
39 files changed:
cinder/api/contrib/cgsnapshots.py [new file with mode: 0644]
cinder/api/contrib/consistencygroups.py [new file with mode: 0644]
cinder/api/v2/views/volumes.py
cinder/api/v2/volumes.py
cinder/api/views/cgsnapshots.py [new file with mode: 0644]
cinder/api/views/consistencygroups.py [new file with mode: 0644]
cinder/common/config.py
cinder/consistencygroup/__init__.py [new file with mode: 0644]
cinder/consistencygroup/api.py [new file with mode: 0644]
cinder/db/api.py
cinder/db/sqlalchemy/api.py
cinder/db/sqlalchemy/migrate_repo/versions/025_add_consistencygroup.py [new file with mode: 0644]
cinder/db/sqlalchemy/migrate_repo/versions/026_add_consistencygroup_quota_class.py [new file with mode: 0644]
cinder/db/sqlalchemy/models.py
cinder/exception.py
cinder/quota.py
cinder/scheduler/driver.py
cinder/scheduler/filter_scheduler.py
cinder/scheduler/manager.py
cinder/scheduler/rpcapi.py
cinder/tests/api/contrib/test_cgsnapshots.py [new file with mode: 0644]
cinder/tests/api/contrib/test_consistencygroups.py [new file with mode: 0644]
cinder/tests/api/v2/test_volumes.py
cinder/tests/policy.json
cinder/tests/scheduler/fakes.py
cinder/tests/scheduler/test_filter_scheduler.py
cinder/tests/test_create_volume_flow.py
cinder/tests/test_volume.py
cinder/tests/test_volume_rpcapi.py
cinder/tests/utils.py
cinder/volume/api.py
cinder/volume/driver.py
cinder/volume/flows/api/create_volume.py
cinder/volume/flows/manager/create_volume.py
cinder/volume/manager.py
cinder/volume/rpcapi.py
cinder/volume/utils.py
etc/cinder/cinder.conf.sample
etc/cinder/policy.json