Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

LTM pool availability on a GTM irule?

How can we select LTM pool availability on a GTM irule? Something like this?

when DNS_REQUEST {
  if { [active_members LTM_Pool ] =< 3 } {
   pool GTM_Pool
  } else {
  return
 }
}
0
Rate this Question
Comments on this Question
Comment made 22-Sep-2016 by Jinshu 1336

Thats the question exactly i have..

0
Comment made 22-Sep-2016 by crodriguez

It's difficult from your code to figure out just what you're trying to accomplish, especially given the pool names in your example. Are you trying to select a pool of DNS servers to load balance the DNS query to based on availability of its members?

0
Comment made 23-Sep-2016 by F5_Freek 171

Hello,

I'm trying to configure DNS decision based on LTM pool member availability.

0
Comment made 23-Sep-2016 by crodriguez

GTM does not know about LTM's pool members, except in the case where you are load balancing a DNS query to a pool of DNS servers for resolution. In the case of a wide IP, GTM does know about LTM's virtual servers, and can intelligently reply with the IP address of one of those based on criteria you define on the wide IP and wide IP pools, such as geolocation, global availability, etc. You could have GTM reply with the IP address of the LTM virtual server, and then apply an iRule to the LTM virtual server that selects the appropriate LTM pool based on pool member availability.

0
Comment made 24-Sep-2016 by Amanpreet Singh 384

Perhaps, not tested personally, but if your LTM pools contains web servers, you can make use of "HTTP monitor" on GTM to decide LTM_VS status directly from the pool members. BUT this depends how your setup is like. GTM should able to reach ltm pool members directly in your network.

/Aman

0

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I have created an external monitor using tmsh command to achieve this and it's working. Now GTM is making decisions based on the number of Ltm pool member availability.

-Jinshu

0
Comments on this Answer
Comment made 27-Sep-2016 by Jinshu 1336

Configure below script as external monitor. Create new monitor using this external script and append it in the VIP along with your existing health monitor. Change the 'Availability Requirement ' to 'All'.

Above script monitor the availability of the pool members. If it is less than 3, then it will change the wide-ip lb method.

#!/bin/sh
pidfile="/var/run/$MONITOR_NAME.$1..$2.pid"
# Send signal to the process group to kill our former self and any children
# as external monitors are run with SIGHUP blocked
if [ -f $pidfile ]
then
    kill -9 -`cat $pidfile` > /dev/null 2>&1
fi
echo "$$" > $pidfile

pool=Enter Pool Name
minup=3
virtual=Enter VIP name
wideip=Enter Wide IP Name

upmembers=`tmsh show /ltm pool $pool members |grep "Current Active Members" |awk -F" : " '{ print $2 }'`

if [ $upmembers -ge $minup ]
then
    rm -f $pidfile
    state=`tmsh show /gtm wideip $wideip | grep "Availability" |awk -F" : " '{ print $2 }'`
    if [ $state == "available" ]
    then
        logger -p local0.info -t MONITOR-ALERT "Pool $pool Monitor UP - changing the lb method to global-availability"
        tmsh modify /gtm wideip $wideip pool-lb-mode global-availability
    fi
    echo "up"
else
    rm -f $pidfile
    state=`tmsh show /gtm wideip $wideip | grep "Availability" |awk -F" : " '{ print $2 }'`
    if [ $state == "available" ]
    then
        logger -p local0.info -t MONITOR-ALERT "Pool $pool Monitor DOWN - changing the lb method to ratio"
        tmsh modify /gtm wideip $wideip pool-lb-mode ratio
    fi    
    echo "up"
fi

Hope this helps. Let me know if any issues.

-Jinshu

0