Forum Discussion

Stefan_Klotz_85's avatar
Jun 23, 2015

Dynamic Pool assignment with APM in 10.2.4

I know in v11 there is a dedicated element in VPE called "Pool Assignment", but how need this be configured in v10? Right now I'm using the iRule-Event and the corresponding iRule triggers correctly. Even all the variable calculations and assignments are working fine (validated via logging), but at the end the pool-command seems to be not executed. The connection is broken (I assume due to missing pool) and also if I sniffer the traffic towards the poolmembers, I see nothing in the output. Is the "ACCESS_POLICY_AGENT_EVENT" too late in traffic handling and the pool-command will not be recognized anymore?

 

So how can I assign a pool and poolmember dynamically with APM in v10.2.4?

 

Thank you!

 

Ciao Stefan :)

 

5 Replies

  • ACCESS_POLICY_AGENT_EVENT is triggered only once.

    In version 11, APM variable session.assigned.pool is set to the pool member and read for every connection related to the APM session.

    If you want the same behavior in version 10, assign pool name in a custom variable and assign the following irule to the VS:

    when HTTP_REQUEST {
        set varpool [ACCESS::session data get session.custom.pool]
        if {$varpool eq ne ""} {
            pool $varpool
        }
     }
    
  • Hi Stanislas,

    good idea, but I'm getting the following error message when trying to safe the iRule:

    [command is not valid in current event context (HTTP_REQUEST)] [ACCESS::session data get session.custom.pool_name]
    

    I also was thinking about global variables or the table command, but is the APM event triggered before the HTTP_REQUEST? I mean what happened when the HTTP_REQUEST is triggered, but the variable is not set? How can I guarantee this?

    Thank you!

    Ciao Stefan 🙂

  • I added a test to check if session cookie exist. In version 11, "ACCESS::session data get" is valid in HTTP_REQUEST event. try with session variable between quotes:

    when HTTP_REQUEST {
        if {[HTTP::cookie exists MRHSession]}{
            set varpool [ACCESS::session data get "session.custom.pool_name"]
            if {$varpool eq ne ""} {
                pool $varpool
            }
        }
     }
    
  • Still the same error message:

    [command is not valid in current event context (HTTP_REQUEST)] [ACCESS::session data get "session.custom.pool_name"]
    

    Seems to be not possible with v10 that way 😞 I will try it with the session or table command.

    Ciao Stefan 🙂

  • you can try the first irule in the Event ACCESS_ACL_ALLOWED

     

    Assign a ACL allowing traffic to raise this event.