'Builds a mirror view operation class.
:param configuration: driver configuration
:param failover: True if from primary to configured array,
False if from configured array to primary.'

def build_mirror_view(self, configuration, failover=True):

    rep_devices = configuration.replication_device
    if (not rep_devices):
        LOG.info('Replication    is    not    configured    on    backend:    %s.', configuration.config_group)
        return None
    elif (len(rep_devices) == 1):
        if (not self.client.is_mirror_view_enabled()):
            error_msg = _('Replication    is    configured,    but    no    MirrorView/S    enabler    installed    on    VNX.')
            raise exception.InvalidInput(reason=error_msg)
        rep_list = common.ReplicationDeviceList(configuration)
        device = rep_list[0]
        primary_client = self._build_client_from_config(self.config)
        secondary_client = client.Client(ip=device.san_ip, username=device.san_login, password=device.san_password, scope=device.storage_vnx_authentication_type, naviseccli=self.client.naviseccli, sec_file=device.storage_vnx_security_file_dir)
        if failover:
            mirror_view = common.VNXMirrorView(primary_client, secondary_client)
        else:
            mirror_view = common.VNXMirrorView(secondary_client, primary_client)
        return mirror_view
    else:
        error_msg = _('VNX    Cinder    driver    does    not    support    multiple    replication    targets.')
        raise exception.InvalidInput(reason=error_msg)
