'Setup replication for LUN, this only happens in primary system.'

def setup_lun_replication(self, volume, primary_lun_id):

    specs = common.ExtraSpecs.from_volume(volume)
    provision = specs.provision
    tier = specs.tier
    rep_update = {'replication_driver_data': None, 'replication_status': fields.ReplicationStatus.DISABLED}
    mirror_name = utils.construct_mirror_name(volume)
    if specs.is_replication_enabled:
        LOG.debug('Starting    setup    replication    for    volume:    %s.', volume.id)
        lun_size = volume.size
        pool_name = utils.get_remote_pool(self.config, volume)
        emc_taskflow.create_mirror_view(self.mirror_view, mirror_name, primary_lun_id, pool_name, volume.name, lun_size, provision, tier)
        LOG.info('Successfully    setup    replication    for    %s.', volume.id)
        rep_update.update({'replication_status': fields.ReplicationStatus.ENABLED})
    group_specs = common.ExtraSpecs.from_group(volume.group)
    if (volume.group and group_specs.is_group_replication_enabled):
        LOG.debug('Starting    add    volume    %(volume)s    to    group    %(group)s', {'volume': volume.id, 'group': volume.group.id})
        group_name = utils.construct_group_name(volume.group)
        self.client.add_mirror(group_name, mirror_name)
    return rep_update
