HPE 3PAR - Implement Tiramisu feature on 3PAR

In Tiramisu, a group construct is used to manage the group
of volumes to be replicated together for the ease of management.
This patch adds this support to the HPE 3PAR driver.

Change-Id: I6c214ec868d907ae8edb7546c5f939b0522b20ba
Implements: blueprint hpe3par-replication-group
This commit is contained in:
kushal 2017-12-15 05:17:21 -08:00 committed by Kushal Wathore
parent 9a31b4c8f5
commit 3da071994b
4 changed files with 1957 additions and 84 deletions

File diff suppressed because it is too large Load Diff

View File

@ -55,10 +55,11 @@ class HPE3PARDriverBase(driver.ManageableVD,
1.0.0 - Initial base driver
1.0.1 - Adds consistency group capability in generic volume groups.
1.0.2 - Adds capability.
1.0.3 - Added Tiramisu feature on 3PAR.
"""
VERSION = "1.0.2"
VERSION = "1.0.3"
def __init__(self, *args, **kwargs):
super(HPE3PARDriverBase, self).__init__(*args, **kwargs)
@ -189,7 +190,7 @@ class HPE3PARDriverBase(driver.ManageableVD,
def create_group(self, context, group):
common = self._login()
try:
common.create_group(context, group)
return common.create_group(context, group)
finally:
self._logout(common)
@ -346,15 +347,61 @@ class HPE3PARDriverBase(driver.ManageableVD,
self._logout(common)
@utils.trace
def failover_host(self, context, volumes, secondary_id=None):
def failover_host(self, context, volumes, secondary_id=None, groups=None):
"""Force failover to a secondary replication target."""
common = self._login(timeout=30)
try:
# Update the active_backend_id in the driver and return it.
active_backend_id, volume_updates = common.failover_host(
context, volumes, secondary_id)
active_backend_id, volume_updates, group_update_list = (
common.failover_host(
context, volumes, secondary_id, groups))
self._active_backend_id = active_backend_id
return active_backend_id, volume_updates, []
return active_backend_id, volume_updates, group_update_list
finally:
self._logout(common)
def enable_replication(self, context, group, volumes):
"""Enable replication for a group.
:param context: the context
:param group: the group object
:param volumes: the list of volumes
:returns: model_update, None
"""
common = self._login()
try:
return common.enable_replication(context, group, volumes)
finally:
self._logout(common)
def disable_replication(self, context, group, volumes):
"""Disable replication for a group.
:param context: the context
:param group: the group object
:param volumes: the list of volumes
:returns: model_update, None
"""
common = self._login()
try:
return common.disable_replication(context, group, volumes)
finally:
self._logout(common)
def failover_replication(self, context, group, volumes,
secondary_backend_id=None):
"""Failover replication for a group.
:param context: the context
:param group: the group object
:param volumes: the list of volumes
:param secondary_backend_id: the secondary backend id - default None
:returns: model_update, vol_model_updates
"""
common = self._login()
try:
return common.failover_replication(
context, group, volumes, secondary_backend_id)
finally:
self._logout(common)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
---
features:
- |
Added replication group support in HPE 3PAR cinder driver.