Forum Discussion
Http class to irule conversion?
Does anyone know how to convert a http class to an irule. Starting with version 11.4 it seems http classes do not exist anymore. I need to convert a lot of http classes to an irule for a new device with version 11.6. Does anyone have a tool/script that does this?
Yes you are right.
Now one last thing. I need to convert pools form version 9 or 10 to version 11.6 I have more than 500 pools.
A pool in the old bigip looks like this :
pool Test80 { monitor all UptimeTesting and gateway_icmp members 10.160.4.11:http 10.160.4.12:http }
I need it to look like this in the new big ip (ver 11.6.):
ltm pool /Common/pTestPool { members { /Common/10.160.4.11:80 { address 10.160.4.11 } /Common/10.160.4.12:80 { address 10.160.4.12 } } monitor /Common/gateway_icmp and /Common/http }
Can you help me with this ?
- Hi mihaic, will it always be an http and gateway_icmp monitor? Thanks, Stephan
No. all will have gateway_icmp monitor. and some http too. But i can add http after. So if i have all pools with gateway_icmp it would be ok.
Thanks !!! a lot for your help.
- Will get my v10 running soon, hopefully. Based on it I will put together a one-liner ...
thanks!!!!!
- shaggyNimbostratus
are you doing an in-place upgrade or a migration to new devices? the f5 upgrade process will (to the best of its ability) automatically convert current configuration formats to that of the new code level. i've done migrations by both converting current config into new config syntax and moving config to new hardware/VE or by upgrading the entire config in a test environment and importing the new config to the new hardware.
are you stuck with doing a migration of old-code/hardware to new-code/hardware, or do you have other options?
Hi mihaic,
sorry, it took a bit longer as I crashed my v10 VE license and had to wait for a nice guy at F5 to provide a new one. Anyway, here we go:bigpipe pool list | grep -oE '^(pool [^ ]+|[[:blank:]]+([0-9]+\.){3}[0-9]+:[[:alnum:]]+)' | \ sed -r ':a;N;$!ba;s/\n[[:blank:]]+/ /g' | \ sed -r 's/pool ([^ ]+) (.*)$/ltm pool \1 { members { \2 } monitor gateway_icmp }/g'
The one-liner above dumps all pool configuration data, extracts name and members only and builds the syntax to import in v11.
Btw, if you are already on v10 you can use the tmsh commands to export the configuration in proper way:tmsh list ltm monitor http tmsh list ltm pool
Commands above provide all data in required format to import directly into v11.
Import works fine via tmsh as well:tmsh load sys config merge file
or inside tmsh:
load sys config merge from-terminal (copy and paste input and press ^D to finish)
Don´t forget to save to startup config afterwards:
tmsh save sys config
Thanks, Stephan
Adding admin domain (/Common/) information to the output (but not mandatory from my perspective):
bigpipe pool list | \ grep -oE '^(pool [^ ]+|[[:blank:]]+([0-9]+\.){3}[0-9]+:[[:alnum:]]+)' | \ sed -r 's/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):([[:alnum:]]+)/\/Common\/\1:\2 { address \1 }/g' | \ sed -r ':a;N;$!ba;s/\n[[:blank:]]+/ /g' | \ sed -r 's/pool ([^ ]+) (.*)$/ltm pool \/Common\/\1 { members { \2 } monitor \/Common\/gateway_icmp }/g'
Nice. It works. Not for all the pools but it works 80% of them Thanks a lot !
- Thanks for the feedback. I´m a bit curious regarding a sample config of the remaining 20% ... :)
All the pools are the same, they use the same monitor. They have similar names. But for some that command probably does not do the conversio to ver 11 In the output i see some pools that appear only with the nad no memebers, monitor.
something like this :
pool pTest3 pool pTest4 ltm pool /common/ptest5 { members { /Common/10....... }
- These are probably pools with no members. The following will provide a list of pools with no members assigned: bigpipe pool list | grep -oE '^(pool [^ ]+|[[:blank:]]+([0-9]+\.){3}[0-9]+:[[:alnum:]]+)' | sed -r 's/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):([[:alnum:]]+)/\/Common\/\1:\2 { address \1 }/g' | sed -r ':a;N;$!ba;s/\n[[:blank:]]+/ /g' | grep -vE '([0-9]+\.){3}[0-9]+:[[:alnum:]]+' | awk '{print $2}'
Looks like this:
pool pTest3
pool pTest4
ltm pool /common/ptest5 { members { /Common/10....... }
No , all pools have at least 1 memeber. i found the issue. Pools with only one member are not converted to version 11. Only the name of the pool appears.
Recent Discussions
Related Content
* 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