Forum Discussion

Eddy_161863's avatar
Eddy_161863
Icon for Nimbostratus rankNimbostratus
May 02, 2016

Which will get priority- irule or LTM policy?

Hi,

 

I have to use both iRule and Policy on a virtual server. So Policy has different rules, which is redirecting the traffic according to incoming headers to different pools for example:

 

If header starts with /abc go to abc pool,

 

if header starts with /xyz go to xyz pool and so on

 

now I want to add persistence irule for one service which is like :

 

if header starts with /abc....

 

{

 

if {....}

 

elseif {....}

 

else{...}

 

}

 

if I apply both iRule and policy which will be executed first?

 

Thanks in advance for your help.

 

1 Reply

  • LTM Local Traffic Policy is executed and evaluated first, then the iRule

     

    On another note, if your Local Traffic Policy is done with choosing a destination pool, it may not be where the requests will actually be routed to. Once the iRule is processed, and the outcome of destination pool selection is different, then the last choice is what matters. Effectively, an iRule can over-ride the decisions that were made by the LTM Policy. If you can, try to keep all pool-selection stuff in LTM Local Traffic Policy (or in iRule, if the functionality of LTM policy is insufficient for your scenario).

     

    In your case, a configuration where persistence iRule is used on top of a pool-selection LTM policy should work without any problems.