targets.append(remote_target)
return {'volume_id': volume['id'],
'targets': targets}
-
- def get_replication_updates(self, context):
- return []
self.assertEqual(expected, ret)
self.driver.backends = backends
-
- def test_get_replication_updates(self,
- mock_close_connection,
- mock_open_connection,
- mock_init):
- ret = self.driver.get_replication_updates({})
- self.assertEqual([], ret)
return {'status': 'deleted'}, updated_snapshots
- def get_replication_updates(self, context):
-
- return []
-
def replication_disable(self, context, volume):
if volume['replication_status'] == 'invalid_status_val':
raise exception.CinderException()
volumes_model_update['status'],
"volumes list status failed")
- def test_get_replication_updates(self):
- """Get replication updates."""
-
- self.driver.do_setup(None)
-
- ret = self.driver.get_replication_updates(CONTEXT)
- self.assertEqual([], ret)
-
def test_replication_disable(self):
"""Disable replication on the specified volume."""
raise NotImplementedError()
- @abc.abstractmethod
- def get_replication_updates(self, context):
- """Provide a means to obtain status updates from backend.
-
- Provides a concise update for backends to report any errors
- or problems with replicating volumes. The intent is we only
- return something here if there's an error or a problem, and to
- notify where the backend thinks the volume is.
-
- param: context: context of caller (probably don't need)
- returns: [{volid: n, status: ok|error,...}]
- """
- # NOTE(jdg): flush this out with implementations so we all
- # have something usable here
- raise NotImplementedError()
-
@six.add_metaclass(abc.ABCMeta)
class ManageableSnapshotsVD(object):
replication_targets = {'volume_id': vref.get('id'), 'targets': targets}
LOG.info(_LI('list_replication_targets: %s'), replication_targets)
return replication_targets
-
- def get_replication_updates(self, context):
- # No idea what to do with this.
- return []
"""Failovers volume from primary device to secondary."""
return self.cli.replication_failover(context, volume, secondary)
- def get_replication_updates(self, context):
- """Returns updated replication status from volumes."""
- return self.cli.get_replication_updates(context)
-
def list_replication_targets(self, context, volume):
"""Returns volume replication info."""
return self.cli.list_replication_targets(context, volume)
"""Failovers volume from primary device to secondary."""
return self.cli.replication_failover(context, volume, secondary)
- def get_replication_updates(self, context):
- """Returns updated replication status from volumes."""
- return self.cli.get_replication_updates(context)
-
def list_replication_targets(self, context, volume):
"""Returns volume replication info."""
return self.cli.list_replication_targets(context, volume)
'provider_location': provider_location}
return model_update
- def get_replication_updates(self, context):
- """Return nothing since Cinder doesn't do anything."""
- return []
-
def list_replication_targets(self, context, volume):
"""Provides replication target(s) for a volume."""
targets = {'volume_id': volume.id, 'targets': []}
return existing_vluns
# v2 replication methods
- def get_replication_updates(self, context):
- # TODO(aorourke): the manager does not do anything with these updates.
- # When that is chanaged, I will modify this as well.
- errors = []
- return errors
-
def replication_enable(self, context, volume):
"""Enable replication on a replication capable volume."""
if not self._volume_of_replicated_type(volume):
finally:
self._logout(common)
- def get_replication_updates(self, context):
- common = self._login()
- try:
- return common.get_replication_updates(context)
- finally:
- self._logout(common)
-
def replication_enable(self, context, volume):
"""Enable replication on a replication capable volume."""
common = self._login(volume)
finally:
self._logout(common)
- def get_replication_updates(self, context):
- common = self._login()
- try:
- return common.get_replication_updates(context)
- finally:
- self._logout(common)
-
def replication_enable(self, context, volume):
"""Enable replication on a replication capable volume."""
common = self._login(volume)
return volume_types.get_volume_type(ctxt, type_id)
# v2 replication methods
- def get_replication_updates(self, context):
- # TODO(aorourke): the manager does not do anything with these updates.
- # When that is changed, I will modify this as well.
- errors = []
- return errors
-
def replication_enable(self, context, volume):
"""Enable replication on a replication capable volume."""
model_update = {}
"""Obtain volume repliction targets."""
return self.replica.list_replica_targets(vref)
- def get_replication_updates(self, context):
- # NOTE(jlc): The manager does not do aynthing with these updates.
- # When that is changed, here must be modified as well.
- return []
-
class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
"""ISCSI driver for Huawei storage arrays.
return storwize_rep.StorwizeSVCReplicationMetroMirror(
self, rep_target, StorwizeHelpers)
- def get_replication_updates(self, context):
- # TODO(vhou): the manager does not need to do anything so far.
- replication_updates = []
- return replication_updates
-
def migrate_volume(self, ctxt, volume, host):
"""Migrate directly if source and dest are managed by same storage.
context, group, volumes, cgsnapshot, snapshots,
source_cg, source_vols)
- def get_replication_updates(self, context):
- """Get replication updates."""
-
- return self.xiv_ds8k_proxy.get_replication_updates(context)
-
def replication_disable(self, context, volume):
"""Disable replication on the specified volume."""
data["targets"] = remote_targets
return data
- def get_replication_updates(self, context):
- # currently, the manager does not use these updates.
- # TODO(mudassir): update this when implemented in manager
- return []
-
def _get_current_array(self, volume):
current_array, _ = self._get_arrays(volume)
return current_array
# queue it to be sent to the Schedulers.
self.update_service_capabilities(volume_stats)
- if volume_stats.get('replication_enabled', False):
- # replciation_status provides a concise update of
- # replicating volumes and any error conditions
- # detected by the driver. The intent is we don't
- # expect/worry about updates so long as nothing
- # changes, but if something goes wrong this is a
- # handy mechanism to update the manager and the db
- # possibly let the admin/user be notified
-
- # TODO(jdg): Refactor the check/update pieces to a
- # helper method we can share
- # We want to leverage some of the same update model
- # that we have in the targets update call
-
- replication_updates = (
- self.driver.get_replication_updates(context))
- for update in replication_updates:
- pass
-
def _append_volume_stats(self, vol_stats):
pools = vol_stats.get('pools', None)
if pools and isinstance(pools, list):