Hi Jungyi,
You could solve this scenario with the LTM Priority group feature in combination with some iRule code.
The first step would be to create two additional pools, with absolutely identical settings and member nodes as the one currently in use. Name these pools "pool_http_a" and "pool_http_b".
Then increase the priority of node_a in pool_http_a and the priority of node_b in pool_http_b to a value greater than 0, as outlined in the chapters "Priority group number" and "Priority-based member activation" of this guide...
https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-concepts-11-1-0/ltm_pools.html1216212
Now you've three pools for your two servers, where the original pool would still load balance the requests and two new pools for your servers would perform an active/standby configuration where each is prefering either node a or node b.
Now you could select those pools as required by using iRules:
when HTTP_REQUEST {
if { [IP::addr [IP::client_addr] equals 10.1.0.0/16] } then {
Send requests prefered to node A and use B as standby
pool pool_http_a
} elseif { [IP::addr [IP::client_addr] equals 10.2.0.0/16] } then {
Send requests prefered to node B and use node A as standby
pool pool_http_b
} default {
Balance requests either to node B or node A
pool pool_http
}
}
Note: If using different route groups, then you may have change the [IP::client_addr] command to exclude the route domain sufix.
Cheers, Kai