Forum Discussion

Shivesh_Rege's avatar
Shivesh_Rege
Icon for Nimbostratus rankNimbostratus
May 20, 2009

Irule Prefernce

Hi All:

 

 

I guess irules take prefernce from top to bottom.So if I have 2 irules .It will pass on 1st with one in top list and next 2nd .Please correct me if I am wrong?

 

 

Regards,

 

Shivesh

7 Replies

  • Thanks Aaron .. It was pretty quick .. possibly this one which is comming might be bit tricky....

     

     

    Is there any option to enable /disable an Irule on demand rather than going on GUI by removing the same from virtual server...

     

     

    Thanks for prompt response..

     

    Thanks in Advance..

     

  • I guess it depends on what exactly you mean by "on demand".

     

     

    If you mean that when a certain pattern of traffic flow is detected you want to stop processing the iRule, you can use the event disable command (Click here) or the return command (Click here) to manage this on a per-connection basis.

     

     

    If you mean administratively removing the iRule, the GUI is probably the easiest way, unless you want to develop a custom iControl application that would be able to toggle the use of iRules on a particular virtual server.

     

     

    Denny
  • Hi Denny,

     

    Thanks for reply.However I was more inclined to wards more faster mode of option in switching over irules as tere are many virtual servers which need maintance page depending on requirement.I.e like.

     

     

    when LB_FAILED {

     

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

     

    HTTP::redirect "http://[HTTP::host]/error/404.html"}

     

     

    This I guess will cover if pool memebers are not available i.e servers are down/port not listening on maintaince.

     

     

    However we also have requirement that when the servers are up but want to place maintanance page for internal team to verify and make available after testing .I am placing a differnt irule which will re-direct based on content of [HTTP::host] which will replace this one.So found some stuff on command line.Could you tell me if it will work ?

     

     

    Option to switchover in time of adhoc maintainance page required

     

    login to Bigip console.

     

     

     

    bp> virtual rule none

     

    bp> virtual rule

     

     

    and once the request is to place back normal irule

     

     

    bp> virtual rule none

     

    bp> virtual rule < normal_redirection_irule>

     

     

    Or

     

     

    bp> virtual rule

     

     

    !!!!once the request is to place back normal irule!!!

     

     

    bp> virtual rule < normal_redirection_irule>
  • Shivesh: there are a couple of other options here that may be worth looking into, but without more information on how you've got your hosting environment set up it's a little hard to say which one is best. In the hopes that something sticks, I'll toss a couple out.

     

     

    1) Take advantage of priority grouping. For example, you could have a simple page that you monitor on the web servers, and when the dev team needs to test a new release on a particular set of servers they can simply toggle that page's content - for example, from "Pass" to "Fail" or similar. This will cause the health check to fail and your 'fallback' servers will come online and serve your maintenance page. The drawback to this approach is that you'll have to be very careful to disable the right set of servers (i.e. the systems with the higher priority in the pool). There's also more setup involved with this.

     

     

    2) Use iControl to manually disable the systems in question. This is something that your dev team can automate relatively easily and it'll work great. You can manually disable the higher priority systems and let the fallback systems in the priority group serve up the maintenance page. The drawback here is that it may not be granular enough for you to deal with per-host maintenance windows.

     

     

    3) Take advantage of the 'fallback host' setting in the HTTP profile, so when you disable the servers you can automatically fall back. The drawback here is that it's a fairly 'global' thing to do, so if you're doing lots of name-based virtual hosts it may not fit every situation.

     

     

    4) Use an iRule with a data group that contains a set of hostnames to selectively disable. This will probably get you closest to your 'dynamic' setup, as you can automatically update this list via (you guessed it!) iControl. So for example you could use something like this: http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=3005&view=topic. While their goals are different in this thread, the technique still applies.

     

     

    This last option would be my guess as the most useful one for you.

     

    I hope this helps,

     

    Matt
  • If that's the case I'd probably just write 2 bash shell scripts that ran those bigpipe commands in sequence (one to place maintenance page, one to go back to normal). Maybe a (y/n) toggle switch on each virtual name if you didn't want to just blow all 40 in at once.

     

     

    Denny
  • Denny's idea is a good one. Also note that iControl would work here too (no need for any app changes, by the way). If you're interested in offloading this work to the development group so they can enable/disable the redirect rules for their own list of Virtual Servers, iControl would be a great approach.

     

    -Matt