cinder/cinder
xing-yang 18744ba199 Tiramisu: replication group support
This patch adds support for replication group.
It is built upon the generic volume groups.
It supports enable replication, disable replication,
failover replication, and list replication targets.

Client side patch is here:
    https://review.openstack.org/#/c/352229/

To test this server side patch using the client side patch:
export OS_VOLUME_API_VERSION=3.38

Make sure the group type has group_replication_enabled or
consistent_group_replication_enabled set in group specs,
and the volume types have replication_enabled set in extra specs
(to be compatible with Cheesecake).

cinder group-type-show my_group_type
+-------------+---------------------------------------+
| Property    | Value                                 |
+-------------+---------------------------------------+
| description | None                                  |
| group_specs | group_replication_enabled : <is> True |
| id          | 66462b5c-38e5-4a1a-88d6-7a7889ffec55  |
| is_public   | True                                  |
| name        | my_group_type                         |
+-------------+---------------------------------------+

cinder type-show my_volume_type
+---------------------------------+--------------------------------------+
| Property                        | Value                                |
+---------------------------------+--------------------------------------+
| description                     | None                                 |
| extra_specs                     | replication_enabled : <is> True      |
| id                              | 09c1ce01-87d5-489e-82c6-9f084107dc5c |
| is_public                       | True                                 |
| name                            | my_volume_type                       |
| os-volume-type-access:is_public | True                                 |
| qos_specs_id                    | None                                 |
+---------------------------------+--------------------------------------+

Create a group:
cinder group-create --name my_group my_group_type my_volume_type
cinder group-show my_group

Enable replication group on the primary storage:
    cinder group-enable-replication my_group
Expected results: replication_status becomes “enabled”.

Failover replication group to the secondary storage.
If secondary-backend-id is not specified, it will go to the
secondary-backend-id configured in cinder.conf:
    cinder group-failover-replication my_group
If secondary-backend-id is specified (not “default”), it will go to
the specified backend id:
    cinder group-failover-replication my_group
--secondary-backend-id <backend_id>
Expected results: replication_status becomes “failed-over”.

Run failover replication group again to fail the group back to
the primary storage:
    cinder group-failover-replication my_group
--secondary-backend-id default
Expected results: replication_status becomes “enabled”.

Disable replication group:
    cinder group-disable-replication my_group
Expected results: replication_status becomes “disabled”.

APIImpact
DocImpact
Implements: blueprint replication-cg

Change-Id: I4d488252bd670b3ebabbcc9f5e29e0e4e913765a
2017-04-30 22:49:13 -04:00
..
api Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
backup Ceph: Fix delete backup with non-existent pool 2017-06-01 20:40:04 +08:00
brick Give more time for LVM deactivation 2017-04-28 14:14:16 -05:00
cmd Merge "Make cinder-manage online migrations more verbose" 2017-03-27 10:14:48 +00:00
common Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
compute Send global_request_id to nova/glance when calls are made 2017-06-08 07:48:30 -04:00
config Add warning header to opts.py file 2017-06-05 13:00:44 -05:00
consistencygroup Merge "Add quota limit check and enhance roll back for cg create" 2017-03-20 13:13:08 +00:00
db Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
group Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
hacking Revert "Using assertFalse(A) instead of assertEqual(False, A)" 2017-06-06 19:43:10 +00:00
image Send global_request_id to nova/glance when calls are made 2017-06-08 07:48:30 -04:00
interface Allow Pure drivers to handle detach with no host 2017-06-07 10:59:42 -07:00
keymgr Remove log translations 2017-03-19 14:59:57 +00:00
locale Imported Translations from Zanata 2016-10-15 07:34:30 +00:00
message Improve help for periodic message_reap_interval 2017-04-19 10:03:52 -05:00
objects Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
scheduler Merge "Add volume type filter to API Get-Pools" 2017-06-02 00:04:00 +00:00
tests Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
transfer Trivial fix typos while reading code 2017-05-04 10:27:57 +07:00
volume Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
wsgi Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
zonemanager Trivial fix typos 2017-06-01 09:25:28 +07:00
__init__.py Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat 2016-11-11 13:19:07 -06:00
context.py Remove log translations 2017-03-19 14:59:57 +00:00
coordination.py coordination: remove un-used method is_active() 2017-05-18 21:17:52 +02:00
exception.py Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
flow_utils.py Fix logging traceback in service logs 2016-12-20 12:39:07 +05:30
i18n.py Remove log translations 2017-03-19 14:59:57 +00:00
manager.py Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
opts.py VMAX driver - Base functionality, replacing SMI-S with REST 2017-06-06 19:32:14 +00:00
policy.py Use to_policy_values for enforcing policy 2016-09-13 01:13:15 +00:00
quota.py Periodic task to clean expired reservation 2017-05-30 22:21:38 +08:00
quota_utils.py Add Generic Volume Group Into Quota Management 2017-05-26 01:43:23 +00:00
rpc.py Merge "Remove old oslo.messaging transport aliases" 2017-03-27 16:34:25 +00:00
service.py Use HostAddressOpt for opts that accept IP and hostnames 2017-04-05 22:19:06 -04:00
ssh_utils.py Remove log translations 2017-03-19 14:59:57 +00:00
test.py Fix py27 gate - Remove Tooz usage for tests 2017-05-18 17:20:47 +02:00
utils.py Check the volume metadata value is a string or not 2017-05-22 21:37:16 -04:00
version.py