'Setup replication for volume, if enabled.
Called on create volume, create cloned volume, create volume from
snapshot, manage_existing, and re-establishing a replication
relationship after extending.
:param array: the array serial number
:param volume: the volume object
:param device_id: the device id
:param extra_specs: the extra specifications
:param target_device_id: the target device id
:returns: replication_status -- str, replication_driver_data -- dict'

def setup_volume_replication(self, array, volume, device_id, extra_specs, target_device_id=None):

    source_name = volume.name
    LOG.debug('Starting    replication    setup    for    volume:    %s.', source_name)
    (rdf_group_no, remote_array) = self.get_rdf_details(array)
    rdf_vol_size = volume.size
    if (rdf_vol_size == 0):
        rdf_vol_size = self.rest.get_size_of_device_on_array(array, device_id)
    target_name = self.utils.get_volume_element_name(volume.id)
    if (not target_device_id):
        rep_extra_specs = self._get_replication_extra_specs(extra_specs, self.rep_config)
        volume_dict = self._create_volume(target_name, rdf_vol_size, rep_extra_specs)
        target_device_id = volume_dict['device_id']
    LOG.debug('Create    volume    replica:    Target    device:    %(target)s    Source    Device:    %(source)s    Volume    identifier:    %(name)s.', {'target': target_device_id, 'source': device_id, 'name': target_name})
    rdf_dict = self.enable_rdf(array, device_id, rdf_group_no, self.rep_config, target_name, remote_array, target_device_id, extra_specs)
    LOG.info('Successfully    setup    replication    for    %s.', target_name)
    replication_status = REPLICATION_ENABLED
    replication_driver_data = rdf_dict
    return (replication_status, replication_driver_data)
