Forum Discussion
hooleylist
Jun 14, 2012Cirrostratus
Hi Brian,
Did you have an else clause in the if statement? If so, you were assigning a pool in all cases in the iRule. If you didn't have an else clause, I'd guess it was just coincidence that you noticed the issue after changing to a switch statement.
I think it's most intuitive if you use an iRule to assign a pool in some cases to do it in all cases. If you want to reference the VS default pool, you can save the name in CLIENT_ACCEPTED:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/app1*" {
pool pool_app1
}
"/app2*" {
pool pool_app2
}
default {
pool $default_pool
}
}
}
Or if you want to avoid specifying the pool in each iRule condition, you could add a OneConnect profile to the virtual server. If you're using SNAT, you can use the default OneConnect profile with a /0 source mask. Else, create a custom /32 source mask OneConnect profile and add that to the virtual server.
Aaron