Forum Discussion

dragonflymr's avatar
dragonflymr
Icon for Cirrostratus rankCirrostratus
May 19, 2015

virtual command and reselecting

Hi,

 

I tried to figure it out but it is to complicated considering my knowledge of iRules.

 

Scenario:

 

  • VS that based on URI is directing traffic to different VSs using virtual command
  • If there is no path specified (just "/") traffic should not be directed to other VS but processed by switching VS
  • Everything is OK when first connection without any path is performed - traffic processed by switching VS
  • When connection using given path is performed like /compress it's correctly directed to other VS
  • Then when another connection (with cache and cookies cleared in browser) is again not using any path (just "/") it's not processed by switching VS but directed to previously selected VS

I am pretty sure it has something to do with info from virtual command description "In order to make this functionality work, one must precede the virtual command with an LB::reselect command if a pool member has already been selected". Problem is that I don't know how to use it or if this is indeed correct command to use.

 

Especially that only events LB:reselect can be used are LB_SELECTED, LB_QUEUED, PERSIST_DOWN, LB_FAILED.

 

When using [LB::select] in SERVER_CONNECTED log message I can see that before virtual is used pool name is logged (is pool /Common/pool member IP:PORT), after virtual is used then log entry is listing ip of target VS to which virtual command switched traffic (node IP:PORT - where this is ip and port of VS, called here node for some reason).

 

Then subsequent connections without path specified (new http sessions as cookies and cache is cleared, no persistence used on switching VS) are all directed to this "node", there is even no SERVER_CONNECTED event fired.

 

Data used to switch VSs (or stay on switching VS) is retrieved from URI (so in HTTP_REQUEST), I am not sure in which events related to this variables from HTTP_REQUEST event could be used and most important how to reset VS selections so for "/" connection is again processed by switching VS.

 

Piotr

 

2 Replies

  • It sounds like the front end vip is not using oneconnect? If you using an irule to make layer 7 pool or virtual decisions then you need to have oneconenct enabled on the front end vip, or use the detach command in the irule so you can make a layer 7 decision for every get in the same http connection. https://devcentral.f5.com/wiki/iRules.LB__detach.ashx without oneconnect or a detach command in the irule every request in the http1.1 session will go to the same pool

     

    • dragonflymr's avatar
      dragonflymr
      Icon for Cirrostratus rankCirrostratus
      Well, probably I should use OneConnect (will test it). Right now I figured out how and where to place LB::detach. Will post cleaned iRule later on - maybe will be useful for someone else :-) Piotr