Forum Discussion

nick_66950's avatar
nick_66950
Icon for Nimbostratus rankNimbostratus
Aug 17, 2007

Can't seem to call a pool using iRules

Hi,

 

 

We use the following version of BIG-IP Version BIG-IP 9.1.2 Build 40.6

 

 

We have run out of valid IP addresses so wanted to implement a way of sharing a single IP/ single virtual server for different domains that point to different pools. I hoped to do this using the following.

 

 

when HTTP_REQUEST {

 

log local0. "Client Connected, HTTP: [HTTP::host]"

 

 

 

if { [HTTP::host] equals "ads01.olas.net" } {

 

log local0. "chose ads01"

 

pool ADS-HTTP-Pool

 

}

 

if { [HTTP::host] equals "adsv2.olas.net" } {

 

log local0. "chose adsv2_01"

 

pool ADSv2_01 member 10.100.105.1 80

 

}

 

}

 

 

The IRule runs and I get the log output of "chose adsv2_01" but the passing on to the pool seems to fail. When a web browser points it takes a while to fail but gets a "The connection was reset"

 

 

Does anyone have any idea what I might be doing wrong.
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Member syntax for pool command is correct, and I don't see anything syntactically wrong with the rule (although I do agree with wshultz about the logical construct improvements).

     

     

    But do first examine the Local Traffic log for any runtime errors -- the rule will abort processing if any are encountered.

     

     

    That aside, it looks like the selected pool member is not responding, so we need to start looking at the pool ADS-HTTP-Pool and/or see what happens to the connection after a pool member is chosen.

     

     

    First be sure your pool members are monitored appropriately and showing UP (green).

     

     

    If they are, try adding more code to determine what happened after the pool was selected (LB_SELECTED or LB_FAILED should be sufficient, but I included them both as examples of post-selection checkpoints.)
    when HTTP_REQUEST {
      switch [string tolower [HTTP::host]] {
        ads01.olas.net {
          log local0. "chose ads01"
          pool ADS-HTTP-Pool
        }
        adsv2.olas.net {
          log local0. "chose adsv2_01" 
          pool ADSv2_01 member 10.100.105.1 80
        }
      }
    }
    when LB_SELECTED {
      log local0. "Selected server: [LB::server]" 
    }
    when LB_FAILED {
      log local0. "Selected server: [LB::server]" 
    }
    LB_SELECTED will be triggered if a pool member is selected. LB_FAILED will be triggered if no pool member is selected or if the selected member fails to respond.

     

     

    LB::server returns a Tcl list containing pool name, member address and port. If no server was selected (all servers down), returns pool name only.

     

     

    HTH

     

    /deb
  • Hi

     

     

    First of all thanks for the quick replies. I have tried your suggestions and it seems that the LB does select and the LB:Failed does not get called. But still I get no output. I am pretty sure that the servers/monitor/pool are up as if I choose a default pool then it works. Unfortunatly I do not get anything usefull out of the log. For instance the LB:Failed does not get called.

     

     

    My Irule now:

     

    when HTTP_REQUEST {

     

     

     

    switch [string tolower [HTTP::host]] {

     

     

     

    ads01.olas.net {

     

     

     

    log local0. "chose ads01"

     

     

     

    pool ADS-HTTP-Pool

     

     

     

    }

     

     

     

    adsv2.olas.net {

     

     

     

    log local0. "chose adsv2_01"

     

     

     

    pool ADSv2_01 member 10.100.105.1 80

     

     

     

    }

     

     

     

    }

     

     

     

    }

     

     

     

    when LB_SELECTED {

     

     

     

    LB::server returns a Tcl list containing

     

     

     

    pool name, member address and port.

     

     

     

    If no server was selected (all servers down),

     

     

     

    returns pool name only.

     

     

     

    log local0. "LB Selected server: [LB::server]"

     

     

     

    }

     

     

     

    when LB_FAILED {

     

     

     

    LB::server returns a Tcl list containing

     

     

     

    pool name, member address and port.

     

     

     

    If no server was selected (all servers down),

     

     

     

    returns pool name only.

     

     

     

    log local0. "Selected server failed: [LB::server]"

     

     

     

    }

     

     

    Logs:

     

    Mon Aug 20 01:43:40 BST 2007 tmm tmm[735] Rule ADSIRule : LB Selected server: ADS-HTTP-Pool 10.100.105.4 80

     

    Mon Aug 20 01:43:40 BST 2007 tmm tmm[735] Rule ADSIRule : chose ads01

     

    Mon Aug 20 01:42:00 BST 2007 wikkitgate2 system_check 010d0005 Chassis fan 103: status (0) is bad.

     

    Mon Aug 20 01:41:35 BST 2007 tmm tmm[735] Rule ADSIRule : LB Selected server: ADSv2_01 10.100.105.1 80

     

    Mon Aug 20 01:41:35 BST 2007 tmm tmm[735] Rule ADSIRule : chose adsv2_01