'Failover a backend to a secondary replication target.'

def _complete_failover(self, source_backend_name, replication_targets, flexvols, volumes, failover_target=None):

    volume_updates = []
    active_backend_name = (failover_target or self._choose_failover_target(source_backend_name, flexvols, replication_targets))
    if (active_backend_name is None):
        msg = _('No    suitable    host    was    found    to    failover.')
        raise exception.NetAppDriverException(msg)
    source_backend_config = config_utils.get_backend_configuration(source_backend_name)
    self.update_snapmirrors(source_backend_config, source_backend_name, flexvols)
    failed_to_break = self.break_snapmirrors(source_backend_config, source_backend_name, flexvols, active_backend_name)
    for volume in volumes:
        replication_status = fields.ReplicationStatus.FAILED_OVER
        volume_pool = volume_utils.extract_host(volume['host'], level='pool')
        if (volume_pool in failed_to_break):
            replication_status = 'error'
        volume_update = {'volume_id': volume['id'], 'updates': {'replication_status': replication_status}}
        volume_updates.append(volume_update)
    return (active_backend_name, volume_updates)
