Forum Discussion

Francis2_160228's avatar
Francis2_160228
Icon for Nimbostratus rankNimbostratus
Jan 05, 2016

Delete Persistence record by iRule command

Hello,

 

on our customer LTM (11.6.0) there are 3 virtual servers for exchange services ( rpc, rpc mapi and rpc address book), they use same IP with different ports , generated by iApp f5.microsoft_exchange_2010_2013_cas.v1.4.0.

 

those 3 virtual servers have the same persistence profile (source address) with Match Across Services enabled, so they share the same persistence record for every source address. But due to operational reasons, some customization have been done by an iRule, where for some source IP addresses:

 

- the connections need to be distributed to a specific member if it is available ( one to one connection )

 

- with availability of the other members to handle connections in case if that desired member is not available, and fail over back if that desired member comes up again.

 

part of the iRule behind each virtual server looks like below ( 3 iRule look the same with diffirent Ports and pool names):

 

when CLIENT_ACCEPTED {

 

if { ([LB::status pool pool_name member $CAS_member port_num] eq "up") } {

 

pool pool_name member $CAS_member port_num

 

} else {

 

pool pool_name

 

TCP::collect 1

 

}}

 

when CLIENT_DATA {

 

if { !( [LB::server addr] equals $CAS_member ) and ([LB::status pool pool_name member $CAS_member port_num] eq "up")} {

 

reject

 

persist delete source_addr [IP::client_addr]

 

}

 

TCP::release

 

TCP::collect 1

 

}

 

The iRule is working well as expected, except one thing which has no real impact but I would to know the reason of that. when there is fail over back, sometimes not all persistence records of a specific source address are being deleted, I mean not all, because usually there are few records of each source IP per tmm. and the one which is not being deleted, belongs to the tmm owner.

 

why not all being deleted ? and how can I delete all of them for a specific source IP address?

 

Thanks in advance for your answers and support.

 

2 Replies

  • Simply the question is, does the command "persist delete source_addr [IP::client_addr] " delete all persistence records from all tmm for a specific source source ? the issue explain above, could be related to the settings " Match Across Services enabled " ? any answer or experience is appreciated.
  • Hi Francis,

    the option "Match Across Services" allows you to use shared persistence records, if the involved virtuals server and/or pool members (of the same pool) are sharing the same IP addresses.

    To be clear:

    If the individual virtual servers are pointing to the same pool, you would see just a single persistence record getting created for each clients.

    client_addr -> virtual address:* -> pool_a -> node_a:*

    If the the virtuals using multiple or independent pools, each pool would still have its own persistence record.

    client_addr -> virtual address:* -> pool_a -> node_a:*

    client_addr -> virtual address:* -> pool_b -> node_a:*

    The command

    persist delete source_addr [IP::client_addr]
    would not delete all persistence records for the given client_addr. It would just delete the records related to the current session.

    client_addr -> virtual address:* -> pool_a

    or

    client_addr -> virtual address:* -> pool_b

    To remove additional records outside of the current session, you may pass additional options to the

    [persist]
    command. The options are...

    persist delete source_addr [list [IP::client_addr] any virtual]
    persist delete source_addr [list [IP::client_addr] any service]
    persist delete source_addr [list [IP::client_addr] any pool]
    persist delete source_addr [list [IP::client_addr] any]
    

    ... or even a combination of those ...

    persist delete source_addr [list [IP::client_addr] any service any pool]
    

    In addition its noteworthy to mention, that the

    [persist delete]
    command will only delete a single record per execution. So if you need to remove more than one record, then you have to use a
    [while]
    ,
    [for]
    or
    [foreach]
    loop.

    Hope this helps...

    Cheers, Kai