Forum Discussion

danielpenna's avatar
Jun 25, 2014

Best Practice - Maintenance Pages when LB_Failed

Hey Guys, Historically we have provided our users with the below iRule to through up a maintenance page when the pool/members fail. We have been caught out just recently when a dozen sites got updated pools but due to user/admin error no one updated the maintenance page iRule. The servers in the old pools got decommissioned and an error page was thrown.

          when HTTP_REQUEST {  
                if {[active_members Pool-old-pool-name] < 1 } {
                        HTTP::respond 200 content "

I have been investigating a better method to do this without direct referencing the pool name. I was looking at and testing in our PreProduction enviornment the event LB_FAILED but ran into truncated responses and was given this reference article via F5 support ( http://support.f5.com/kb/en-us/solutions/public/9000/400/sol9456.html ). So that means that avenue is closed.

What is the best practise for error pages without directly refercing the pool name.

Thanks

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    This should do the trick:

    if { [active_members [LB::server pool] ] < 1 } {

  • If you want to reference the default pool that is associated with the irule on a VS, then you can just use [LB::server pool]

    
    when HTTP_REQUEST {
       if {[active_members [LB::server pool]] < 1 } {
          HTTP::respond 200 content
       }
    }
    

    If you want to send the connection to an alternate pool when the default pool is down, but not use a pool name, you can use an HTTP::redirect and just manage the maintenance pool via it's own VS and Dns entry. You could also setup a global static variable that all irules can access on an LTM system with a value of the alternate pool

    Hope this helps

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    By the way, you may want to change the response to:

    HTTP::respond 503 content "

    That would reflect the proper server status and keep the SEO-people happy.

  • Stephan_Schulz1's avatar
    Stephan_Schulz1
    Historic F5 Account

    Hi Arie,

     

    no worries about the global static variables. Only the "non" static global variables will result in CMP demotion.

     

    Cheers Stephan

     

  • I was looking at and testing in our PreProduction enviornment the event LB_FAILED but ran into truncated responses and was given this reference article via F5 support ( http://support.f5.com/kb/en-us/solutions/public/9000/400/sol9456.html ). So that means that avenue is closed.

    isn't the workaround usable?

    Disabled the pool member and I sometimes get the error message, sometimes not, sometimes the error message is inserted into the text boxes on the screen.

    what error did you get?

    can you post the irule?

     tmsh list ltm rule (name)
    
  • Please check SOL6510. http://support.f5.com/kb/en-us/solutions/public/6000/500/sol6510.html?sr=11563781