LB::reselect

Description

This command is used to advance to the next available node in a pool, either using the load balancing settings of that pool, or by specifying a member explicitly. Note that the reselect may not happen immediately; it may wait until the current iRule event is completely finished executing.
There is no reselect retry limit built into the command: You MUST implement a limiting mechanism in your iRule using logic similar to that in the examples below. For more information, refer to AskF5 SOL10386 - Using LB::reselect iRules command without a limiting mechanism may result in a SYN flood

Syntax

LB::reselect
LB::reselect nexthop <IP address>
LB::reselect node <node_ip_address> <node_port>
LB::reselect pool <pool_name>
LB::reselect pool <pool_name> member <member>
LB::reselect rateclass <rateclass name>
LB::reselect virtual <virtual server name>
LB::reselect vlan <vlan name>

LB::reselect

  • Selects the next available member in the current pool, based on pool Load Balancing options

LB::reselect nexthop <IP address>

  • Selects the MAC address for the selected IP address as the nexthop
  • See nexthop for possible additional options

LB::reselect pool <pool_name>

  • Selects the next available member in the specified pool, based on the Load Balancing options of that pool

LB::reselect pool <pool_name> <member>

  • Selects the specified member from the specified pool

LB::reselect rateclass <rateclass name>

  • Selects the specified rate class

LB::reselect virtual <virtual server name>

  • Selects the specified virtual server

LB::reselect vlan <vlan name>

  • Selects the specified VLAN

Examples

when CLIENT_ACCEPTED {
  set def_pool [LB::server pool]
  set lb_fails 0
}
when LB_FAILED {
  if { $lb_fails < [active_members $def_pool] } {
    LB::mode rr
    LB::reselect pool $def_pool
  } else {
    ... add failure logic here
  }
  incr lb_fails
}

when CLIENT_ACCEPTED {
  set def_pool [LB::server pool]
  set lb_fails 0
}
when LB_SELECTED {
  if { $lb_fails < [active_members $def_pool] } {
    LB::mode rr
    LB::reselect pool $def_pool
  }
  incr lb_fails
}

Version Specific Notes

LTM 9.2 When load balancing fails to a selected member, the iRule LB::reselect command repeatedly attempts to connect to the unavailable member, rather than selecting the next available pool member. See AskF5 SOL8188 (CR84102) (deb)
LTM 9.3, 9.4, & 9.3.1 When load balancing fails to a selected member, the iRule LB::reselect command repeatedly attempts to connect to the unavailable member, rather than selecting the next available pool member. See AskF5 SOL8188 (CR85186) (deb)
LTM 9.0 - 9.4.4 SOL8724 - Use of LB::detach and LB::reselect within an LB_FAILED event causes a system crash - deb (31 Oct 2008)
LTM 9.4.5 SOL9278 - Using iRules LB::detach command then selecting a new load balancing target may stall connection - deb (31 Oct 2008)

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.