Forum Discussion
Mike_Maher
Feb 10, 2014Nimbostratus
Have you looked at Local Traffic policy to determine if you can just use that and get rid of this iRule completely? You have the ability in LT policy to pull traffic one way or the other with it and it is a lot more flexible than HTTP Classes were.
Here is an iRule that I had that contains some HTTP Class Events and actions that I moved over to 11.4.1
when CLIENT_ACCEPTED {
set retries 0
}
when HTTP_CLASS_SELECTED {
if {[HTTP::class] eq "/Common/hqdesktop-securera-8000_class"}{
set backup_pool PHX-hqdesktop-8000.edwardjones.com_pool
}
if {[HTTP::class] eq "/Common/desktop-securera-8000_class"}{
set backup_pool PHX-desktop-8000.edwardjones.com_pool
}
}
when LB_FAILED {
if { $retries < [active_members $backup_pool] } {
LB::mode rr
LB::reselect pool $backup_pool
incr retries
}
}
when CLIENT_ACCEPTED {
set retries 0
}
when HTTP_REQUEST {
set policy [POLICY::names matched]
if {[POLICY::rules matched $policy] eq "hqdesktop-securera-8000_class_policy_rule"}{
set backup_pool PHX-hqdesktop-8000.edwardjones.com_pool
}
if {[POLICY::rules matched $policy] eq "desktop-securera-8000_class_policy_rule"} {
set backup_pool PHX-desktop-8000.edwardjones.com_pool
}
}
when LB_FAILED {
if { $retries < [active_members $backup_pool] } {
LB::reselect pool $backup_pool
incr retries
}
}
If you find you need to keep the iRule then hopefully this helps spurs some thoughts on how to re work your iRule