Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Persistence across virtuals

Environment: 11.6.0 HF6 on a vCMP guest

I have two virtual servers, one with a persistence profile and one without. I am trying to query the persistence table from an iRule on the VS without a persistence profile, and the query is returning nothing. Is there some requirement for configuring a VS to allow it to query the persistence table?

### VS with persistence
ltm virtual VS_jenise {
    destination 1.1.1.1:http
    ip-protocol tcp
    mask 255.255.255.255
    persist {
        JenUniversal {
            default yes
        }
    }
    pool pool_jenise
    profiles {
        http { }
        tcp { }
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    vs-index 18
}

ltm persistence universal JenUniversal {
    app-service none
    defaults-from universal
    rule JenPersistence
    timeout 1800
}

ltm rule JenPersistence {
   when CLIENT_ACCEPTED {
     set myKey JEN2
     persist uie $myKey 1800
     log local0. "Set persistence, going to look it up"
     set persistInfo [persist lookup uie "JEN2"]
     log local0. "I set my universal persistence to:  $persistInfo"
  }
}

### VS without persistence
ltm virtual VS_jenise2 {
    destination 1.1.1.2:http
    ip-protocol tcp
    mask 255.255.255.255
    pool pool_jenise
    profiles {
        http { }
        tcp { }
    }
    rules {
        TestLookup
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    vs-index 21
}

ltm rule TestLookup {
    when HTTP_REQUEST {
       log local0. "****************** hi jen!"
       set persistInfo [persist lookup uie "JEN2"]
       log local0. "****************** here persistInfo is .$persistInfo."
   }
}

Here is the output from accessing the first virtual server:

May  3 06:56:21 myLTM info tmm[14401]: Rule /Common/JenPersistence <CLIENT_ACCEPTED>: Set persistence, going to look it up
May  3 06:56:21 myLTM info tmm[14401]: Rule /Common/JenPersistence <CLIENT_ACCEPTED>: I set my universal persistence to:  /Common/pool_jenise 2.2.2.2 80

The persistence table shows the entry:

root@(myLTM)(cfg-sync Changes Pending)(Active)(/Common)(tmos)# show ltm persistence persist-records
Sys::Persistent Connections
universal  JEN2                       1.1.1.1:80    2.2.2.2:80    (tmm: 0)

Accessing the second VS shows an empty query result:

May  3 06:56:32 myLTM info tmm[14401]: Rule /Common/TestLookup <HTTP_REQUEST>: ****************** hi jen!
May  3 06:56:32 myLTM info tmm[14401]: Rule /Common/TestLookup <HTTP_REQUEST>: ****************** here persistInfo is ..

Do I need some sort of persistence profile on the second VS to even be able to query the table?

Thanks, Jen

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

e.g.

# config

root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos)# list ltm virtual one
ltm virtual one {
    destination 172.28.24.248:80
    ip-protocol tcp
    mask 255.255.255.255
    persist {
        universal {
            default yes
        }
    }
    pool foo
    profiles {
        http { }
        tcp { }
    }
    rules {
        ruleone
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    vs-index 19
}
root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos)# list ltm virtual two
ltm virtual two {
    destination 172.28.24.249:80
    ip-protocol tcp
    mask 255.255.255.255
    pool foo
    profiles {
        http { }
        tcp { }
    }
    rules {
        ruletwo
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    vs-index 20
}
[root@ve11c:Active:In Sync] config # tmsh list ltm rule ruleone
ltm rule ruleone {
    when HTTP_REQUEST {
  persist uie [HTTP::path]
  log local0. "persist uie [HTTP::path]"
}
}
[root@ve11c:Active:In Sync] config # tmsh list ltm rule ruletwo
ltm rule ruletwo {
    when HTTP_REQUEST {
  log local0. "\[persist lookup uie \"[HTTP::path] any virtual\"\] = [persist lookup uie "[HTTP::path] any virtual"]"
}
}

# test

[root@ve11c:Active:In Sync] config # tail -f /var/log/ltm
May  3 23:14:20 ve11c info tmm[9061]: Rule /Common/ruleone <HTTP_REQUEST>: persist uie /hello
May  3 23:14:25 ve11c info tmm1[9061]: Rule /Common/ruletwo <HTTP_REQUEST>: [persist lookup uie "/hello any virtual"] = /Common/foo 200.200.200.101 80
0
Comments on this Answer
Comment made 03-May-2016 by dubdub 358
Hi Nitass, I was able to try the "any virtual" option, and it did enable me to see the persistence record from the second VS. Thank you very much for the help! Thanks, Jen
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

can you try this?

[persist lookup uie "JEN2 any virtual"]
0