Forum Discussion

Naumin_Dave_144's avatar
Naumin_Dave_144
Icon for Nimbostratus rankNimbostratus
Nov 12, 2016

Irule to change VS status

Hi All,

we need your help to achieve one requirement. Not sure we can achieve this with Irule or not. we have following Irule on our production VS.

when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::path]] {
        "/axis/*"   {
         SSL::disable serverside
            pool pool1
        }
        default     {
            pool default_pool
        }
    }
}

application team requirement is when default_pool goes down, VS status should be down.(even though pool1 is UP). can we achieve this with some modification in irule or with different options.

5 Replies

  • I don't think you need to modify the iRule at all. Just add your default_pool to your virtual server profile as the default pool. That will be the only pool that is monitored from the virtual server perspective. If that pool is unavailable, the virtual server will also be unavailable.

     

  • If your goal is to prevent load balancing from happening if the default pool is down, can't you use a simple iRule that serves a maintenance page or sorry page whenever the default pool is down instead of marking the entire VS as down ?

     

  • This irule will reject connections if no pool members in the default pool are down, but like Odaah mentioned maybe you could do a redirect to a maintenance page instead of a reject.

    when HTTP_REQUEST {
    
         reject connection if all servers are down in the default pool
        if { [active_members [LB::server pool]] < 1 } {
            reject
        }
    
        switch -glob [string tolower [HTTP::path]] {
            "/axis/*"   {
             SSL::disable serverside
                pool pool1
            }
            default     {
                pool default_pool
            }
        }
    }
    
  • Hi All,

     

    First of all thank you very much for your reply on this conversation. DevCentral always helps us to learn new things faced by all F5 champs across world. I would like to explain bit more on requirement part.

     

    Since we have GTM(DC/DR) setup for this VS, if default_pool is down then it should mark VS down so that GTM will forward the traffic to the alternate VS. so by applying maintenance page here will not resolve the purpose of the requirement.

     

  • Hicham's avatar
    Hicham
    Icon for Nimbostratus rankNimbostratus

    Hello Naumin Dave,

    we're facing your exact situation. How did you manage to get around this issue.

    Thank for sharing.