There is no native functionality I am aware of to do this.
If the VIP still has members UP, in the associated pool, it will report to the GTM that the VIP is available.
There may be more simple ways to do this, but here is a way that would work.
- Create a new dummy VIP on the LTM, that matches the existing VIP, with a new IP.
-
Put an iRule on that VIP, that will check the pool member count, and reject connections if it drops below a threshold.
when CLIENT_ACCEPTED {
if {[active_members PoolHTTPS] < 1}{
reject
}
-
Then monitor this VIP, outside iquery, from the GTM. Do not build this under an LTM Server Object, but as a Generic Host.
- Create a dependency on the GTM between this object and the one you already have. ( I might be missing some additional creativity that is required to make the dependency. Sorry, I do not have an environment to test this idea in, atm)
So, when you drop below the server count threshold, the dummy VIP will start rejecting the monitor connections, and the dependency should take the associated site offline.
With that said, I am not sure why you would want to do this, and with that information the community may be able to come up with a better solution to your original dilemma.
Good Luck!