Forum Discussion

4 Replies

  • This is how I might do it:

    1. Create your 4 pools and apply application-specific monitors to each (to test availability of a given URI).

    2. Apply the following iRule logic (modify as required):

      when HTTP_REQUEST {
          if { [active_members poolA] < 1 } {
              drop
          } else {
              switch -glob [string tolower [HTTP::uri]] {
                  "/app1*" { pool poolA }
                  "/app2*" { pool poolB }
                  "/app3*" { pool poolC }
                  default {
                      drop
                  }
              }
          }
      }
      

    So in this case, assuming poolA is the pool that contains the URI that must always be available, the monitor applied to poolA will determine if the given URI is alive. If not, drop the request. Otherwise switch between the pools based on the URI.

  • It depends on how you wrote the iRule but I would do a switch statement with a default case to catch it when no matches are made, something like this:

     

    https://devcentral.f5.com/questions/irule-to-select-pool-based-on-fqdn

     

  • Do I still need to include a POOL in the Virtual Server configuration? I notice if I don't it goes into unknown status.

     

  • As long as you're providing pool assignment inside the iRule, then you don't technically need a pool assigned to the VIP.