Forum Discussion
kman_52500
Nimbostratus
May 16, 2012replacing defined iRules for a vip
I'm trying to update the list of iRules on a virtual but I don't want to delete then add because that leaves the virtual without any rules temporarily.
I've opened an enhancement request to add a...
George_Watkins_
May 17, 2012Historic F5 Account
kman,
This can already be done from the web UI and tmsh. From the web UI you can edit the assign rules and place them in any order you like, then update the virtual. tmsh offers the equivalent functionality of "replace with" from the web UI (see below).
test-ltm-01(Active)(/Common)(tmos) list /ltm virtual test-http-virtual-02.element.local
ltm virtual test-http-virtual-02.element.local {
destination 10.84.3.227:http
ip-protocol tcp
mask 255.255.255.255
pool test-ubuntu-lucid_http
profiles {
http { }
tcp { }
}
rules {
xml-to-http-header
}
snat automap
vlans-disabled
}test-ltm-01(Active)(/Common)(tmos) modify /ltm virtual test-http-virtual-02.element.local rules { exp_backoff vip-target-vip sqrt math } results in:
test-ltm-01(Active)(/Common)(tmos) list /ltm virtual test-http-virtual-02.element.local
ltm virtual test-http-virtual-02.element.local {
destination 10.84.3.227:http
ip-protocol tcp
mask 255.255.255.255
pool test-ubuntu-lucid_http
profiles {
http { }
tcp { }
}
rules {
exp_backoff
vip-target-vip
sqrt
math
}
snat automap
vlans-disabled
} I agree that historically it would have been nice to have a method to do this, but it isn't necessary in version 11. This behavior can be implemented with iControl transactions, which were introduced in version 11. The idea is that you start a transaction, execute iControl calls as you normally would, then submit the transaction. Action will only be taken if all the commands will execute correctly. The transaction will cause the iControl commands to be executed in parallel and should not impact your users (unless of course they were dependent on the iRules that you remove). Here is an article I wrote on transactions when we launched version 11: v11 iControl: Transactions. In the next post is a code sample written in Java provide the functionality you are requesting.
Best regards,
George
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
