Forum Discussion
stucky101_88485
Nimbostratus
Feb 26, 2013Cannot add 3rd irule to vip due to priority error even if priorities are different
Gurus
I posted this on the pycontrol group already but it's probably more of an icontrol so I'm posting it here again.
https://devcentral.f5.com/community/group/aft/2166035/asg/4
For t...
Brent_West_7733
Mar 03, 2013Historic F5 Account
The reason I thought that rule priorities might re-order is that is how certain other interfaces within iControl behave. Pool Members in GTM for example, re-order to be gapless.
After testing...
//Removed all rules for /Common/test
//get_rule for /Common/test
//add_rule for {'rule_name': 'rule_0' 'priority': '0'}
//get_rule for /Common/test
Rules for virtual /Common/test
Rule Name: /Common/rule_0
Rule Priority: 0 //What I expected
//add_rule for {'rule_name': 'rule_0', 'priority': '0'}{'rule_name': 'rule_1', 'priority': '100'}{'rule_name': 'rule_2', 'priority': '200'}{'rule_name': 'rule_3', 'priority': '50'}{'rule_name': 'rule_2', 'priority': '400'}
//get_rule for /Common/test
Rules for virtual /Common/test
Rule Name: /Common/rule_0
Rule Priority: 0
Rule Name: /Common/rule_1
Rule Priority: 100 //Not what I expected
Rule Name: /Common/rule_2
Rule Priority: 200 //Again, not what I expected
Rule Name: /Common/rule_3
Rule Priority: 50 // This one is now in the proper processing order to fire before rule_1, rule_2, rule_4
Rule Name: /Common/rule_4
Rule Priority: 400
//add_rule for {'rule_name': 'rule_5', 'priority': '1'}
//get_rule for /Common/test
Rules for virtual /Common/test
Rule Name: /Common/rule_0
Rule Priority: 0
Rule Name: /Common/rule_1
Rule Priority: 100
Rule Name: /Common/rule_2
Rule Priority: 200
Rule Name: /Common/rule_3
Rule Priority: 50
Rule Name: /Common/rule_4
Rule Priority: 400
Rule Name: /Common/rule_5
Rule Priority: 1 //Fires after rule_0, and before all other rules
To answer your original question, this is why priorities are important when adding rules, since they are stateful, not gapless, and cannot be inserted to force an adjacent rule down, you must explicitly define the order you wish them to run in.
When created by the GUI, they are applied in order 0,1,2,3,4,5 with no gaps. When you assign them via iControl, they are assigned with the priorities you specify.
If you were to someday have a need to insert a rule in between 2 gapless rules, you would first need to remove the rule with the higher priority. And since this may impact the whole rule chain, you may need to remove them all in order to insert the new rule at the beginning of the list, change the rule priorities in your dictionary, and then re-add them.
To answer your maintenance rule question, I didn't mean to say that you should permanently remove them, I only meant to say they you would need to remove them to re-prioritize them and add them back with your new rule, all within one run of the program. Once your maintenance was over you would simply 'remove_rule(virtualserver, rule_name)'
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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