For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Andrea_Frances1's avatar
Andrea_Frances1
Icon for Nimbostratus rankNimbostratus
Sep 07, 2005

Use of Irules in persistence profile and vs

Hi All,

 

 

I'm having seriuos problems understanding the difference (if any) between the use of iRules directly in a virtual server and "indirectly" through a persistence profile.

 

 

Let me explain better.

 

 

As far as I've understood , one can create a Virtual server, go to the resources tab and "bind" an Irule to that server.

 

At this point te traffic is matched against the irule and when the conditions are met ( CLIENT_CONNECT,LB_SELECT...) some actions are performed.

 

These actions can be also actions to change the persistence condition for this VS, using the persist statement,etc,etc...

 

This is what I see as a "direct" method to use iRules.

 

 

Another use of iRules is to create a persistence profile with uie or hash as parent and

 

apply an Irule to this profile.

 

Then apply this profile to a VS.

 

 

What I do not understand what is the difference between writing an Irules in the first case and in the second case.

 

 

And, assumed that my aim is to change somehow the persistence of a VS, should I use the first method or the second one and what's the difference?

 

 

Thank you.

 

 

P.S. I read thoroughly the chater 13 (writing Irules) and saw the tech tips&docs on this portal, but they seem to deal only with the first method...

2 Replies

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    You've asked a very good question.

     

     

    There actually isn't any difference in terms of how the rules are evaluated.

     

    The difference is really how you want to manage the rule.

     

     

    For example, if the rule is really about setting up persistence and a particular virtual simply wants to use that persistence, then putting the rule on the persistence profile might make more sense. This way, if you need to change the rule to include some virtual specific stuff like which pool(s) to use, you can keep that in a separate rule that's only attached to the virtual. Then if you later need to modify either rule, you are not affecting the other. Another case might be that you want to add or remove that persistence on a given virtual, in which case it might make more sense to add or remove the persistence profile instead of the rule.

     

     

    So, in summary, there really isn't any difference in how the rule is evaluated and the difference purely allows for your choice of management.

     

     

    Hope that helps.
  • There's one thing that I didn't still understand.

     

     

    What's the point in having two different irules-based persistence profile types (hash and uie) when the type of persistence is 'de facto' determined by the irule?

     

     

    For example , theorically, I can create an hash persistence profile with an irule that use the command persist uie and viceversa.Can I?

     

     

    Wouldn't be simplier to have a single "irule" persistence profile leaving the choice to select the behaviour (hash or uie) to the irule? (as it seems to happen anyway...)

     

     

    I mean , I have to insert a "persist command" anyway in the irules I associate with the profile...

     

     

    Or I didn't grasp something in your explanation?

     

     

    Thanks.