Forum Discussion
Feb 28, 2015
Hi 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