F5 BIG_IP persistence iRules applied but not affecting selected member

Posted by zoli on Server Fault See other posts from Server Fault or by zoli
Published on 2012-10-04T20:58:48Z Indexed on 2012/10/04 21:40 UTC
Read the original article Hit count: 244

Filed under:
|

I have a virtual server. I have 2 iRules (see below) assigned to it as resources.

From the server log it looks like that the rules are running and they select the correct member

from the pool after persisting the session (as far as I can tell based on my log messages), but the requests are ultimately directed to somewhere else.

Here's how both rules look like:

when HTTP_RESPONSE {

  set sessionId [HTTP::header X-SessionId]

  if {$sessionId ne ""} { 

    persist add uie $sessionId 3600 

    log local0.debug "Session persisted: <$sessionId> to <[persist lookup uie $sessionId]>"

  }

}



when HTTP_REQUEST {

  set sessionId [findstr [HTTP::path] "/session/" 9 /]

  if {$sessionId ne ""} {

     persist uie $sessionId

     set persistValue [persist lookup uie $sessionId]

     log local0.debug "Found persistence key <$sessionId> : <$persistValue>"
  }
}

According to the log messages from the rules, the proper balancer members are selected.

Note: the two rules can not conflict, they are looking for different things in the path. Those two things never appear in the same path.

Notes about the server: * The default load balancing method is RR. * There is no persistence profile assigned to the virtual server.

I'm wondering if this should be adequate to enable the persistence, or alternatively, do I have to combine the 2 rules and create a persistence profile with them for the virtual server?

Or is there something else that I have missed?

© Server Fault or respective owner

Related posts about load-balancing

Related posts about f5-big-ip