Forum Discussion
ML_108504
May 11, 2012Nimbostratus
Most efficient way to re-prioritize a virtual server's iRules?
Hi folks,
I'm writing a powershell script to add and remove a maintenance page redirect iRule to the top of a given virtual server's iRule list (TMOS versions 9.4.x and 10.x). Any given virtual se...
ML_108504
Jul 12, 2012Nimbostratus
OK, bit of follow up here and more questions.
I have added priority 100 statements to all of my outage iRules. All other non-outage iRules have no custom priority set, and should therefore have default priorities of 500. My script code can add and remove the outage irules to the iRule list for any given virtual server. I only need to add one outage iRule to any given virtual server during any given outage scenario. So far so good.
I am attempting to use event disable statements in my outage iRules to ensure that only the outage iRule is evaluated and run for any given connection. That seemed to work just fine in my testing environment (which used dummy virtual servers that had simple iRules applied that just sent http redirects or sent simple html pages back to client browsers). However, in my integration environment (which has slightly more complicated iRules applied to virtual servers) the event disable statements in my outage iRules did not seem to achieve the desired result. My outage iRule would send an http::redirect to any incoming clients and, presuma bly, cease processing any further iRules because my outage iRule ends with an event disable statement.
However, the outage redirect did not seem to work as desired. I received page not found errors instead of the simple html "sorry" page that the http::redirect statement redirected to. When I put the URL that the http::redirect statement returns, the "sorry" page comes up fine. When I hit my test virtual servers that have the outage iRule (with priority 100) and the day-to-day iRule (assumed default priority 500), I do not get the "sorry" page. The iRule that is applied to the virtual servers in question here is essentially just a large switch block, that directs clients to certain pools based upon URI.
I'm assuming that the event disable statement at the end of my outage iRule is all I should need to have the bigip skip processing the day-to-day iRule after processing my outage iRule http::redirect. Is there some other way to ensure that, if two iRules are applied, one with priority 100 and one with priority 500, only the priority 100 iRule will be processed?
Perhaps I should post some example script blocks up here to clarify, I'll get on that after this post.
Thanks!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects