Forum Discussion

John_Watilo_483's avatar
John_Watilo_483
Icon for Nimbostratus rankNimbostratus
Aug 14, 2013

Weighted Least Connections: How to add a pool member via iControl interface

We are using the iControl interface to manipulate pools/members in devices running version 10.2.3. Whenever we have configured a pool with a Load Balancing method of "Weighted Least Connections", and attempt to add a pool member, we get an exception:

 

The weighted least connections algorithm for pool (abc) requires all pool members to have a connection limit.

 

Yet, in either the add_member or add_member_v2 methods of iControl::LocalLB::Pool, I see no means of indicating the connection limit while the member is being added. So, I assume that it is defaulting to zero (unlimited) connections. As you can imagine, this kind of puts us in a catch-22.

 

I'm guessing we might be able to work around this by first changing the pool's load balancing method to something else, then adding our members and setting their connection limits, and then finally switching the LB method back to Weighted Least Connections. Obviously, this is kind of a kludgy way to go about it, and I'd also be concerned about flipping LB methods around for a pool that could easily be taking active connections while this is going on.

 

Am I missing something in the documentation, or is there a better workaround for this problem?

 

Thanks in advance, John

 

3 Replies

  • You're right, it's a trap !

    I don't know if this would work in your solution, but one workaround might be to use the "weighted-least-connections-node" load balancing mode. Then you could create the node with a connection limit and add it to a pool:

    !/usr/bin/env ruby
    
    require "rubygems"
    require "f5-icontrol"
    
    @ic = F5::IControl.new("10.2.2.29","user","pass", ["LocalLB.Pool","LocalLB.NodeAddress"]).get_interfaces
    
    ipport_def = {"address" => "10.10.10.10", "port" => 80}
    connection_limit = 5
    pool_name = "test_ic_pool"
    
     Create the node
    @ic["LocalLB.NodeAddress"].create([ipport_def['address']],[connection_limit])
    
     Add it as a pool member
    @ic["LocalLB.Pool"].add_member([pool_name],[[ipport_def]])
    

    I guess there is the option of writing a weighted least connections (memeber) lb mode in an iRule and disregarding the mode of the actual pool. That way you could dynamically add pool members and not have to worry about this trap.

    Hope that helps

    Phil

    • John_Watilo_483's avatar
      John_Watilo_483
      Icon for Nimbostratus rankNimbostratus
      Well, it doesn't look we can really do it this way. As far as I can tell, by tying the connection limit to the node itself, this will affect ALL pools that reference the particular node. Definitely not what we want to do. Thanks again for your suggestion.