Forum Discussion
Cookie Insert Persistence for 1 VS with 2 Pools
Hi,
As this is my very first question, I thought it best to introduce myself prior to requesting help. 8) I am a network engineer tasked with administration of our F5 load balancers. This primarily entails deployment of tried and true web service configurations. As in most environments, web service deployments change. Although I have some experience and training in administration of the F5's, my iRule development capability is quite limited. Hence why I thought I would ask a question here, prior to loading a case through our current support partner.
I have read a lot of different articles with regards to this question over the past week, and have tried quite a few iRule variations on trying to achieve the goal, but each time some of the results have only added further questions to this challenge.
Ok, to the challenge at hand. I have 1 VS configured in which an iRule URI decider is used to determine which of 2 pools the traffic should be sent to. Pool 1 has 2 nodes, and Pool 2 has 1 node. One of the webpages located on the Pool 1 nodes, has an iFrame which calls page content from the Pool 2 node. It is important at this stage to understand that persistence to the Pool 1 node that the initial connection is established on must be maintained, otherwise you will be sent back to the login screen. Also, I am not using the default cookie names, instead we have a requirement to use non BigIP names in the persistence cookies that are handed to a client.
What I have seen during testing, is some strange occurrences, from the custom cookies for each pool being provided ok, and then in some instances I am seeing a BigIP***** cookie. I have been using Firebug to capture the client side, which is where I have seen any cookie changes during testing. Oh, and OneConnect is not enabled on the VS.
The iRule I have created is as follows:
when HTTP_REQUEST {
set uri1cookie [HTTP::cookie exists {URI1}]
log local0. "URI1Cookie variable value: $uri1cookie"
set uri2cookie [HTTP::cookie exists {URI2}]
log local0. "URI2Cookie variable value: $uri2cookie"
switch -glob [HTTP::path] {
"/uri1*" {
pool POOL_URI1
if {$uri1cookie == 0} {
persist cookie insert URI1
}
}
"/*" {
pool POOL_URI2
if {$uri2cookie == 0} {
persist cookie insert URI2
}
}
}
}
Any pointers or link references that you may have come across, or even modifications to the very basic iRule I have compiled would be appreciated.
Thanks in advance...
3 Replies
- Stanislas_Piro2
Cumulonimbus
Hi,
You tried to do too much validation...
if the cookie was inserted, for the current request, you specified to not use it for persistence but to use the default one.
there was no issue for the current TCP connection because the default behavior is that profiles are assigned for the entire connection. But if the browser open a new connection, the persistence profile was not set with the expected one.
try this irule:
when HTTP_REQUEST { if {[HTTP::path] starts_with "/uri1*"} { pool POOL_URI1 persist cookie insert URI1 } else { pool POOL_URI2 persist cookie insert URI2 } } - Stanislas_Piro2
Cumulonimbus
Hi,
Do you still view default cookie name with the irule i provided?
When you saw in firebug the error, did you see :
- request containing URI1 cookie
- response with URI1 cookie with a different value than request
- Huaxing_Wang
Employee
You may refer the official solution link below
https://support.f5.com/csp/article/K9815
K9815: Using an iRule to select among multiple pools with different members may be incompatible with some cookie persistence configurations
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
