iRule logic to use multiple pools to force GTM failover on VIP
I have a VIP that has no status because the pool that it uses is determined by a policy. To add state to the VIP I've added the following iRule:
when HTTP_REQUEST {
if { [active_members pool1] == 0 } {
# log
}
The VIP now shows a status of green (UP). When I disable the pool members in pool1, the VIP goes down and the GTM routes traffic to another data center.
Since I have a VIP that has multiple pools, I need to fail the VIP if any one pool member is down.
I've tried these examples:
if { [active_members pool1] == 0 } {
# log
}
elseif { [active_members pool2] == 0 } {
# log
}
elseif { [active_members pool3] == 0 } {
# log
}
elseif { [active_members pool4] == 0 } {
# log
}
}
and...
when HTTP_REQUEST {
if { [active_members pool1] == 0 or [active_members pool2] == 0 or [active_members pool3] == 0 }r
# log
}
}
When I take any one pool down, the VIP remains up.
Any suggestions?
Thanks
Kevin