Forum Discussion
JoshuaMessenger
Nimbostratus
Feb 27, 2015How would I use a Table as a global cross tmm variable to be CMP compliant?
I've been asked to handle load-balancing and automatic fail over between an active / passive CIFS / NFS storage system. I have the user_conf setup to monitor the ltm logs and trigger bash scripts on...
StephanManthey
Nacreous
Feb 28, 2015Hi Joshua,
in case you want to follow a table based approach you can use the following code in an iRule to modify the value of the table key "storage_pool" to the name of pool you want to balance to:
when CLIENT_ACCEPTED {
set storage_pool "poolx"
table set storage_switch $storage_pool indef indef
}
On the virtual server balancing the incoming connection the following iRule will lookup the table and select the pool based on the table key´s value:
when CLIENT_ACCEPTED {
log local0. "pool selector: [table lookup storage_switch]"
if { [table lookup storage_switch] equals "poolx" } {
log local0. "using poolx"
pool [table lookup storage_switch]
} else {
log local0. "using [table lookup storage_switch]"
pool [table lookup storage_switch]
}
}
Table´s content is available globally.
I´m wondering why you are not handling the failover via putting pool members into forced offline mode?
In case all storage device are in the same pool you can trigger the switchover by administratively changing the pool member state. Please check as well the "Action on service down" parameter (pool configuration settings).
Thanks, Stephan
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