Forum Discussion
GaryZ_31658
Jul 14, 2008Historic F5 Account
Vip target VIP
All,
I have a scenario where I want to LB "pods" of servers using a Master VIP. I could have many nodes in each pool and do not want to disable each individual node when we take a "pod" offline. It would be a simple task to disable either the pool or the VIP as a whole rather than each individual node.
iRule logic: In the iRule below, we round robin connections to a specific VIP (one defined for each pod). Once at the pool, we set a unique cookie and persist back to the pod as required (each VIP inserts a cookie "my_cookiePodx").
Question: Can I monitor the pool (or VIP) in the iRule for availability so if a pod is offline, the VIP won't send traffic to the disabled pod virtual? I was thinking of using when LB_Failed but the docs suggest fail detection between 9 and 45 seconds. My thoughts are if the VIP is offline, LTM would send a reset and the browser would simply retry. This seems faster but it also seems a little dirty.
when RULE_INIT {
set ::cnt 0
}
when HTTP_REQUEST {
set reqcookie [findstr [HTTP::cookie names] "my_cookie"]
if { $reqcookie starts_with "my_cookie"} {
set podcookie [findstr $reqcookie "my_cookie" 9 " "]
set podvip [findclass "$podcookie" $::pod_vip " "]
virtual $podvip
} else {
incr ::cnt
if { $::cnt <= 3 } {
set ::cnt 1
}
switch $::cnt {
1 { virtual pod1 }
2 { virtual pod2 }
3 { virtual pod3 }
}
}
}
- Deb_Allen_18Historic F5 AccountIt's worth mentioning that the [LB::server pool] command does NOT return the configured default pool. It returns the last selected pool, which means this code:
will still return the previously selected pool (not the default) if it is a subsequent request on a keepalive connection. It would be better to specify the pool name for cases like this.} else { if original pool is down, use the default pool.. User will lose session, but will get page. HTTP::cookie remove "pod" pool [LB::server pool]
- briceNimbostratus
Posted By deb on 07/22/2008 12:11 PM
will still return the previously selected pool (not the default) if it is a subsequent request on a keepalive connection. It would be better to specify the pool name for cases like this.} else { if original pool is down, use the default pool.. User will lose session, but will get page. HTTP::cookie remove "pod" pool [LB::server pool]
- briceNimbostratus
Posted By deb on 07/22/2008 12:07 PM
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects