def convert_persistance_prof(vs, name, tenant_ref):
    """
    This function defines that it convert the persistent profile and
    return that profile
    :param vs: object of lb vs or pool
    :param name: name of application persteance profile
    :param tenant_ref: reference of tenant
    :return: application persistent profile
    """
    profile = None
    persistenceType = vs.get('persistenceType', '')
    timeout = vs.get('timeout', 2)
    if persistenceType == 'COOKIEINSERT':
        profile = {'http_cookie_persistence_profile': {'always_send_cookie':
            False, 'timeout': timeout}, 'persistence_type':
            'PERSISTENCE_TYPE_HTTP_COOKIE', 'server_hm_down_recovery':
            'HM_DOWN_PICK_NEW_SERVER', 'name': name}
    elif persistenceType == 'SOURCEIP':
        timeout = int(timeout) / 60
        if timeout < 1:
            timeout = 1
        profile = {'server_hm_down_recovery': 'HM_DOWN_PICK_NEW_SERVER',
            'persistence_type': 'PERSISTENCE_TYPE_CLIENT_IP_ADDRESS',
            'ip_persistence_profile': {'ip_persistent_timeout': timeout},
            'name': name}
    elif persistenceType == 'SSLSESSION':
        profile = {'server_hm_down_recovery': 'HM_DOWN_PICK_NEW_SERVER',
            'persistence_type': 'PERSISTENCE_TYPE_TLS', 'name': name}
    profile['tenant_ref'] = tenant_ref
    return profile
