'Failover volumes back to secondary array.
Split the replication pairs and make the secondary LUNs R&W.'

def failover(self, volumes):

    volumes_update = []
    for v in volumes:
        v_update = {}
        v_update['volume_id'] = v.id
        drv_data = get_replication_driver_data(v)
        pair_id = drv_data.get('pair_id')
        if (not pair_id):
            LOG.warning('No    pair    id    in    volume    %s.', v.id)
            v_update['updates'] = {'replication_status': 'error'}
            volumes_update.append(v_update)
            continue
        rmt_lun_id = drv_data.get('rmt_lun_id')
        if (not rmt_lun_id):
            LOG.warning('No    remote    lun    id    in    volume    %s.', v.id)
            v_update['updates'] = {'replication_status': 'error'}
            volumes_update.append(v_update)
            continue
        self.rmt_driver.failover(pair_id)
        local_metadata = huawei_utils.get_lun_metadata(v)
        new_drv_data = to_string({'pair_id': pair_id, 'rmt_lun_id': local_metadata.get('huawei_lun_id'), 'rmt_lun_wwn': local_metadata.get('huawei_lun_wwn')})
        location = huawei_utils.to_string(huawei_lun_id=rmt_lun_id, huawei_lun_wwn=drv_data.get('rmt_lun_wwn'))
        v_update['updates'] = {'provider_location': location, 'replication_status': 'failed-over', 'replication_driver_data': new_drv_data}
        volumes_update.append(v_update)
    return volumes_update
