Forum Discussion

Parveez_70209's avatar
Parveez_70209
Icon for Nimbostratus rankNimbostratus
Nov 08, 2013

Syntax to Map Virtual-Server's Character with Data-Group which Contains Pool Name

Kindly have a look into the below Irule:

1.Last part of the Data-Group: dg_parveez_dynamic_pools contains a list of all dynamic pools: 2.Idea is to apply/create a single Irule into the future and attact that into the new Virtual-Servers, and based on that we are planning to add the new dynamic pool into the Data-group created, to make operation task easy and error free. 3. Challenge is: When the user hit the Virtual-server, it should go to the correct Pool which will serve him the request, while matching the name.

when CLIENT_ACCEPTED { set default_pool [LB::server pool] log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" }

when HTTP_REQUEST {

switch -glob [HTTP::uri] {
         "/" {
        log local0. "redirecting from /"
        HTTP::redirect "http://http://www.lenovo.com/us/en" 
        return
       pool pool_lenovo.com-http 
    }

    "/iss_static*" {
        pool $static_pool
        return
    }

    default {
        pool [class match -element [string tolower [virtual]] starts_with dg_parveez_dynamic_pools ]
        return
    }
}

}

  1. Example of the naming convention of the Virtual-Server and Pool mapped against it is:

a) Virtual-Server: apuat.leni2.com-VS-HTTP , Pool : pool_apuat_leni2.com_http b) Virtual-Server: apbuild.leni2.com-VS-HTTP , Pool : pool_apbuild.leni2.com_http c) Virtual-Server: apctdev.leni2.com-VS-HTTP , Pool : pool_apctdev.leni2.com_http

  1. Query: By comparing the above Irule, whether the below Irule part will fit our requirement, I mean can the Virtual-server will be intelligent enough to send the traffic to the correct dynamic pool to meet the requirement, or do we need to modify this:

Naming Convention of the Virtual-Server and Pool is mentioned into the Point 04:

default { pool [class match -element [string tolower [virtual]] starts_with dg_parveez_dynamic_pools ] return }

Kindly suggest.

Thanks and Regards Parveez

37 Replies