Mike_Maher
Jul 02, 2010Nimbostratus
Switching Classes on ASM based on pool availability
I have an ASM with no LTM license, currently it is setup that traffic comes into the VS and is sent to a class based on Host, then run through ASM policy and sent to a pool which contains a node for an internal pool on an LTM. We have created 2 pools per host one for each Data Center. We use DNS internally to control which DC the traffic is sent to, but since ASM is based on IP only and can't use DNS, whenever we fail from one DC to another I must go in and manually repoint the class to the active pool.
So I am trying to craft an iRule on the ASM that can handle this automatically. One thought I had was to create 2 classes one for each DC for each host and them use the iRule to check the pool availability and send to the appropriate class based on that, or perhaps find a way to change the pool that the class is pointed to based on pool availability.
I have gotten this so far I am just trying to figure out if I can assign 2 http classes to a VS that will both match on the traffic and then let this iRule sort out who gets the traffic, also I assume I will have to set a default pool in the VS as well for this to work. Any thoughts or sample code would be appreciated. Thanks
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1
HTTP::class select $anotherHttpClass
else
HTTP::class select $anotherHttpClass
}
}