Forum Discussion

corpkid_17486's avatar
corpkid_17486
Icon for Nimbostratus rankNimbostratus
Aug 07, 2012

Bulk-controlling pool member state - noob question

Hi all,

 

 

We are getting ready to roll out our BigIPs to replace some old Juniper load balancers. That said, the task has fallen on me to create a system that controls pool state, much like we have on our Junipers (accomplished via a series of "saved" SSH commands).

 

 

 

I'm learning this is much different in the F5 world. Here's the deal - I don't program (sys admin) and don't have ready access to a programmer. I do know a little powershell but I am still very much in the learning stages.

 

 

 

That said, I have the sample PoolMemberControl.ps1 script that I found on this site, and it works just fine if you want to manipulate only one pool member at a time. But our devices have MANY pools with MANY members in each (one for each of our 5 physical web servers)... so they need to be manipulated in bulk. So if we want to take down a particular back end application server, I may be targeting 9 pools on just one physical host to disable.

 

 

 

I did get the PoolMemberControl.ps1 to do it by creating ANOTHER PS script and doing this over and over (where 10.x.1.1 is the actual IP of the F5 device, and the 10.x.2.110:PORT is the node name of the pool member)

 

 

 

c:\f5scripts\PoolMemberControl.ps1 10.x.1.1 10.x.2.110:80 Disabled

 

c:\f5scripts\PoolMemberControl.ps1 10.x.1.1 10.x.2.110:443 Disabled

 

 

c:\f5scripts\PoolMemberControl.ps1 10.x.1.1 10.x.2.111:80 Disabled

 

c:\f5scripts\PoolMemberControl.ps1 10.x.1.1 10.x.2.111:443 Disabled

 

 

(...and so on)

 

 

 

It is SLOW to approach it this way and I don't think it's the best approach.

 

 

 

Can anyone offer any advice?

 

 

 

Many thanks!

 

 

 

2 Replies

  • Hi corpkid, you are indeed doing it the long way. With the iControl methods you can pass in arrays of objects allowing you to manipulate many pool members for a given pool or even multiple pools with many pool members in each in a single call.

     

     

    The issues with the sample that you picked out is that it's gracefully shutting down the pool members by disabling new connections, querying the current connection statistics, and then when that reaches zero, turning the monitor state off. If you wanted to keep that functionality in, you'll have to change the method calls to pass in the 2-D parameter for the MemberSessionStateAofA with more values in it for the added pool members, query the statistics for all of them and wait until they all go to zero, and then change the MemberMonitorStateAofA variable to take all the members.

     

     

    Now, if you don't care shutting things down "cleanly", you could just make the two method calls to set_session_enabled_state() and set_monitor_state() with the array of pool members. But, that depends on your implementation.
  • Thanks! I do need to shut them down gracefully so people don't lose their sessions... Not being a programmer/script guy, this is sounding more and more complicated! Ugh.