Forum Discussion

SaranSakthivel's avatar
SaranSakthivel
Icon for Nimbostratus rankNimbostratus
Aug 24, 2016

Cookie Persist with iRule enforced pool member selection

Hi,

 

Setup:

 

Virtual server has a default pool configured.

 

RR is the LB method.

 

Cookie persistence is enabled.

 

Oneconnect profile is enabled.

 

Requirement:

 

When Client initiates its first HTTP request, pool member should be selected based on specific info in the HTTP URI, instead of the normal LB selection process. Ex, 'pool (Pool Name) member (IP) (Port)'. The specific Info in URI which helps in above pool member selection is only available in the first HTTP request.

 

LTM is not inserting appropriate HTTP cookie in the response for the first request, when member selection is done with the following command Ex, 'pool (Pool Name) member (IP) (Port)' . As a result persistence fails for subsequent requests from the client.

 

Is there any way to address it other than going for custom persistence ?

 

Does any one have an iRule to encode the selected member in to the normal cookie format , so that this cookie can be inserted using iRules on HTTP Response?

 

Thanks.

 

1 Reply

  • If your goal is just to persist based on a HTTP header information (like cookie) that is decided based on the 1st HTTP request, you can do something like this:

    when HTTP_REQUEST {
    if { ([HTTP::header header SERVER] ne "") } {
    
    
    
    } else {
    
    
                { HTTP::header insert SERVER 
                  pool POOL_WEB member 10.10.10.10 80 }
    } 
    

    For cookie encoding related coding, see this link and this link.