Jgawrych_43121
Mar 18, 2008Nimbostratus
Kill all active connections to a Vserver during maintenace....
I'm working through a process for placing our site into maintenace mode for application upgrades etc. This process is going to be handed of to 1st level NOC people who are smart but novices to the BigIP - so I want the act of taking a virtual server in and out of maintenace to be a simple and straight forward as possible.
My preffered method for the NOC is to log onto the LTM and disable all pool members for the pool associated with the VServer we want to do maintenace on.
Local Traffic / Pools / "PoolName" / Members Tab. Disable all members.
I have a simple Irule applied to the VServer that I previously found here on Dev central that redirects browsers to a maintenance page when all pool members are down (see bottom of this message for the iRule).
This works as expected for any NEW connections that are initiated to the Vserver. When all the Nodes in a pool are disable, the users browser goes to the maintenace page
My Problem and what I'm looking for help on is that when we go into maintenace, we want ALL sessions through the Vserver to end and go to maintenace page. Don't care if users are in the middle of something - we want all traffic to the web servers behind the BigIP to stop.
However, by default existing connections will remain connected when node/pool member or virtual servers are marked down. In other words, if a user is logged onto the application and has an open browser session, they will stay active on the application even though we've marked everything down . (I was actually pretty surprised to find that there was not a configuration parameter that would by default immediately stop all traffic to Vserver, Pool, Node if it was disabled)
Problem for us because our maintenace usually has the webservers up and functional but we are running DB updates where we do not want user traffic interacting with the DB.
F5 Support pointed me to some Icontrols to kill TCP connections but I'm not sure if iControls are the best route to take on this.
http://devcentral.f5.com/wiki/default.aspx/iControl/System__Connections__delete_active_connection.html
http://devcentral.f5.com/wiki/default.aspx/iControl/System__Connections__delete_all_active_connections.html
http://devcentral.f5.com/Wiki/default.aspx/iControl/System__Connections.html
Anyone have any suggestions on irules that might be able to help? (e.g. an iRule to identify all active connections to a vserver/pool and kill/reset them, etc) Any different approaches any one has used in their production enviroments for halting all traffic to a given VServer during a maintenace event?
Thanks!
-John G
PS - Running BIG-IP 9.3.1 Build 37.1
******************************************************************
Generic iRule to redirect all traffic when all nodes in a pool are down.
when LB_FAILED {
HTTP::redirect "http://maintenance.sitename.com/"
}