'Create a replica.
Create replica for source volume, source can be volume or snapshot.
:param array: the array serial number
:param clone_volume: the clone volume object
:param source_device_id: the device ID of the volume
:param extra_specs: extra specifications
:param snap_name: the snapshot name - optional
:returns: int -- return code
:returns: dict -- cloneDict'

def _create_replica(self, array, clone_volume, source_device_id, extra_specs, snap_name=None):

    target_device_id = None
    clone_id = clone_volume.id
    clone_name = self.utils.get_volume_element_name(clone_id)
    create_snap = False
    try:
        clone_dict = self._create_volume(clone_name, clone_volume.size, extra_specs)
        target_device_id = clone_dict['device_id']
        LOG.info('The    target    device    id    is:    %(device_id)s.', {'device_id': target_device_id})
        if (not snap_name):
            snap_name = self.utils.get_temp_snap_name(clone_name, source_device_id)
            create_snap = True
        self.provision.create_volume_replica(array, source_device_id, target_device_id, snap_name, extra_specs, create_snap)
    except Exception as e:
        if target_device_id:
            LOG.warning('Create    replica    failed.    Cleaning    up    the    target    volume.    Clone    name:    %(cloneName)s,    Error    received    is    %(e)s.', {'cloneName': clone_name, 'e': e})
            self._cleanup_target(array, target_device_id, source_device_id, clone_name, snap_name, extra_specs)
        raise
    return clone_dict
