I have one doubt and will appreciate your feedback.
If there is an iRule matching some URI and redirect to some pool (other than the default one), what will happen for any request with that URI if the pool members are down. It will be dropped or will be forwarded to the default pool ?
I believe the request will be dropped. You can check for this possibility in your iRule and specify another pool if the preferred one contains no active members. See here for the command and an example: https://devcentral.f5.com/wiki/iRules.active\_members.ashx
Now the complain is with server guys saying that they are receiving URI i.e /xyz*, /YwZ*, and /AbC* on the default pool servers, and we have the below iRule defined. In addition, Pool_X sometimes has no members (all are down).
when HTTP_REQUEST priority 10 {
switch -glob [HTTP::path] {
“/xyz*” -
“/YwZ*” -
“/AbC*” { pool Pool_X}
default { pool Default_Pool }
}
}
Just want to confirm, does F5 drop these URIs or just pass it to the default pool in case of Pool_X has no members available.
Actually I don’t want to change any iRules, I need to know why some requests which supposed to go to pool_X are going to default pool. Giving that we have some logs showing pool_X members are down (monitor status’ flapping).
need to know why some requests which supposed to go to pool_X are going to default pool.is there any other irule on the virtual server? i guess it might have since you set priority 10 to the event.
anyway, just a quick confirm. when Pool_X is down, bigip won’t send traffic to Default_Pool and client will receive reset.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/xyz*" -
"/YwZ*" -
"/AbC*" {
pool Pool_X
}
default {
pool Default_Pool
}
}
}
}
[root@ve10:Active] config b pool Pool_X list
pool Pool_X {
monitor all fake
members 200.200.200.111:80 {}
}
[root@ve10:Active] config b pool Default_Pool list
pool Default_Pool {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config b pool Pool_X
POOL Pool_X LB METHOD round robin MIN/CUR ACTIVE MEMBERS 0/0
| (cur, max, limit, tot) = (0, 0, 0, 0)
| (pkts,bits) in = (0, 0), out = (0, 0)
+-> POOL MEMBER Pool_X/200.200.200.111:80 inactive,down
| session enabled priority 0 ratio 1
| (cur, max, limit, tot) = (0, 0, 0, 0)
| (pkts,bits) in = (0, 0), out = (0, 0)
| requests (total) = 0
[root@ve10:Active] config tcpdump -nni 0.0 not host 200.200.200.10 and port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on 0.0, link-type EN10MB (Ethernet), capture size 108 bytes
01:50:36.809874 IP 172.28.20.11.59060 > 172.28.19.79.80: S 2018743163:2018743163(0) win 5840
01:50:36.809921 IP 172.28.19.79.80 > 172.28.20.11.59060: S 1900520667:1900520667(0) ack 2018743164 win 4380
01:50:36.810630 IP 172.28.20.11.59060 > 172.28.19.79.80: . ack 1 win 46
01:50:36.810720 IP 172.28.20.11.59060 > 172.28.19.79.80: P 1:171(170) ack 1 win 46
01:50:36.810842 IP 172.28.19.79.80 > 172.28.20.11.59060: R 1:1(0) ack 171 win 4550
Thanks for your inputs and confirmation for resetting the connection when all members are down.
I have another iRule - not within the iRule I shared so priority won’t differ here.
let’s say the iRule I shared before is iRule-2, and the other iRule is iRule-1. The name reflect their orders to the VS.
iRule-1 has more specific conditions to match i.e the URI will be /xyz/string-1 instead of /xyz*, and when match is there it will redirect, select the same pool (Pool_X) and disable all the events - preventing any further irules processing.
From the above, is there any thing causing F5 to forward /xyz* to the default pool.
iRule-1
when HTTP_REQUEST {
if {([HTTP::header exists “X-Forwarded-For”]) and ([string tolower [HTTP::uri]] contains “/xyz/string-1”)} {
I don’t understand the logic of your rule. If you redirect the client, you can’t also specify a pool. Also, the rule with priority 10 will take precedence.
If there is a match, will any subsequent requests be forwarded to Pool_X ?i do not think so. anyway, why do you need pool command after HTTP::redirect?
Issue: “event disable all” is the cause of URI leaking. The initial request forwarded to Pool_X while subsequent requests are not.
Resolution: using “return” instead which will keep processing subsequent requests but exits from the currently executing event in the currently executing iRule.