Forum Discussion

SAZ_144363's avatar
SAZ_144363
Icon for Nimbostratus rankNimbostratus
May 10, 2016

Disable VIP when pool members are down

Hi Is is possible with iRules to send reset flag to client when health monitor fails on all pool members. We don't want f5 to accept any traffic.

 

Thanks

 

6 Replies

  • Hello,

     

    By design, the VS turn red and reject all connections if all pool members are down.

     

    But you can write an irule and check if there is pool members available with the active_members command and then reject traffic with the reject command

     

    • SAZ_144363's avatar
      SAZ_144363
      Icon for Nimbostratus rankNimbostratus
      Thanks Yann, I am not very much familiar with iRules. Could you please give me sort of example. That would be great. Cheers
  • Hello,

     

    By design, the VS turn red and reject all connections if all pool members are down.

     

    But you can write an irule and check if there is pool members available with the active_members command and then reject traffic with the reject command

     

    • SAZ_144363's avatar
      SAZ_144363
      Icon for Nimbostratus rankNimbostratus
      Thanks Yann, I am not very much familiar with iRules. Could you please give me sort of example. That would be great. Cheers
  • Please find below an example for HTTP (HTTP_REQUEST) and another generic (LB_FAILED) :

    when CLIENT_ACCEPTED {
        set default_pool [LB::server pool]
    }
    
    when HTTP_REQUEST {
        set method [HTTP::method]
        if { [active_members $default_pool] < 1 } { 
            HTTP::respond 200 content [ifile get "/Common/maintenance.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate" 
             reject 
        }
    }
    
    when LB_FAILED { 
      reject
    }
    
  • As a matter of fact, you will not need an Irule for this behaviour. However, You still can use an irule if that is what is expected.

    So here is what you expect

    when HTTP_REQUEST { if { [ active_members [ LB::server pool ] ] <1 } { pool testpool-dc1 } else { [ LB::server ] [ LB::down ] }
    
    }
    when CLIENT_ACCEPTED { if { [ active_members testpool-dc1 ] <1 } { LB::down }
    
    }