Forum Discussion

Keith_11159's avatar
Keith_11159
Icon for Nimbostratus rankNimbostratus
Apr 01, 2008

LBPool.GetPersistenceRecord

I'm new to iControls and I'm a bit confused as to how the GetPersistenceRecord calls work.

 

 

We have BigIP setup such that when a client connects, his connect request has an embedded key. We use this key to load balance all clients with matching keys to the same pool member, using the 'session lookup uie' and 'session add uie' commands to store and retrieve the key->pool member mappings. What I'd like to be able to do with the iControl is pass it a specific key, and have the iControl delete the persistence record associated with that key.

 

 

I'm confused about the LBPool.GetPersistenceRecord(String poolName, LocalLBPersistenceMode mode) and LBPool.deletePersistenceRecord(String[] poolNames, LocalLBPersistenceMode modes[]) methods. I have multiple persistent connections to the same pool under the same mode (uie) each with a different value (key). But based on the method signature, GetPersistenceRecord appears to only return a single record. I'd like to delete a persistence record with a specific value (key), but deletePersistenceRecord doesn't allow me to pass the key name - does that mean it'll delete them all?

 

 

I can run the 'b persist pool mode universal show all' command on the commandline and see that there are multiple persistent connections to the same pool, each with a different value (key). The output seems consistent with my understanding that each pool can have multiple persistence records for each type of persistence mode. Am I looking at the wrong class/methods, or did I misunderstand something?

 

 

I tried to just run the code and see what I got back, but I get an IllegalArgumentException on the GetPersistenceRecord call and I don't have the slightest clue why. Instead I tried calling the multi-argument version GetPersistenceRecord(String[], LocalLBPersistenceMode[]), but I'm getting back 1 row of empty columns. I'm passing the results of getList() for the pool names argument, and I can see my pool name in that list.

 

 

Thanks in advance for any help.

5 Replies

  • Don_MacVittie_1's avatar
    Don_MacVittie_1
    Historic F5 Account
    Hi Keith,

     

     

    Wow, there's a lot in here. Let's start by clearing up your errors so you can run the code without problems.

     

    It sounds like you're using the Java Wrappers for iControl, is that correct?

     

    Do you have the text of the IllegalArgumentException?

     

     

    deletePersistenceRecord(pools[], modes[]) will delete all persistence records that match both the pools in the list and the modes in the list - so all records in mode[0] will be deleted on all pools in the pool list, and the same for mode[1], etc. Since the key is not part of the core API, we don't differentiate between them when deleting persistence records.

     

     

    I hope that at least helps point the way. I'll do a bit more research and prepare some alternatives for you while waiting for answers to the questions above.

     

     

    Don.
  • Yes, I'm using the Java Wrappers for iControl. The exception is at the bottom of this message. When I pass in a pool name that has no persistence records, the method call runs without error and returns null. When I pass in a pool name that does currently have persistence records, I get the IllegalArgumentException.

     

     

    Thank you for the clarification on the deletePersistenceRecord(). So there's no way to delete a specific record with an iControl? And which record does GetPersistenceRecord(String poolName, LocalLBPersistenceMode mode) return? There could be multiple, correct?

     

     

    -Keith

     

     

     

    2008-04-01 13:22:32,563 [ERROR] Exception: - Call

     

    java.lang.IllegalArgumentException

     

    at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)

     

    at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)

     

    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)

     

    at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)

     

    at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)

     

    at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)

     

    at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)

     

    at org.apache.axis.client.Call.invoke(Call.java:2467)

     

    at org.apache.axis.client.Call.invoke(Call.java:2366)

     

    at org.apache.axis.client.Call.invoke(Call.java:1812)

     

    at iControl.LocalLBPoolBindingStub.get_persistence_record(LocalLBPoolBindingStub.java:1857)

     

    at iControlIntermediary.LBPool.GetPersistenceRecord(LBPool.java:468)

     

    at iControlIntermediary.LBPool.GetPersistenceRecord(LBPool.java:478)

     

    at com.manheim.simulcast.App.main(App.java:25)

     

    ; nested exception is:

     

    java.lang.IllegalArgumentException
  • Don_MacVittie_1's avatar
    Don_MacVittie_1
    Historic F5 Account
    The getPersistenceRecord(String poolName, LocalLBPersistenceMode mode) routine returns the first one if there are multiple. I have added to my list that we really should either return the array or let the caller indicate which one they're interested in.

     

     

    I just ran a test of GetPersistenceRecord(String pools[], LocalLBPersistenceMode modes[]), and it seems to function correctly. Are you using partitions on your BIG-IP perhaps? If you are, this call could return an empty set if you do not call the set_active_partition() interface in the System::Management module. If you are using partitions, Joe just published a Tech Tip on them (I haven't read it yet, but Joe knows his stuff), and I can help you work through getting your code set to use them.

     

     

    If you are not running partitions, then I'm stumped. The only way I can think of that you'd get an empty set back is if there were no persistence records for the indicated modes on the indicated pools, and it sounds like that's not true. Let me ponder that one a bit if that's the case.

     

     

    Don.

     

     

  • I don't think we're using partitions - I don't see the Management.Partition.wsdl in the list of Available iControl Service Descriptions. We're using BIG-IP 9.3.1, and from what I saw in the iRule tutorials partitions are only available in 9.4 correct?

     

     

    At any rate, I need to be able to delete a specific persistence record for a given mode/pool, not all of them. An iControl seemed like the ideal solution because it requires authentication (we don't want just anyone to be able to do it) and we could make the call in java. Since an iControl is not possible, are there any similar alternatives? I figure we could use an iRule, but other than some sort of host name check there doesn't seem to be a good way to validate that a given connection has the authority to remove the record. Is this my best option?

     

     

    Thank you again for your time and help.
  • Don_MacVittie_1's avatar
    Don_MacVittie_1
    Historic F5 Account
    Hey Keith,

     

     

    There is no way to my knowledge, but let me stress that my knowledge is not all-inclusive. Let me check and get back to you, though I suspect that there is no way to delete a specific record via iControl, which would indeed leave you with iRules and some tough logic.

     

     

    Don.