dump persistence records

Is it possible to dump the persistence records to a file, using iConntrol? I am using source ip affinity persistence.

Viewing persistence records fro the GUI, generates the following syslog:

mui/locallb/stats/persistence/stats.jsp HTTP/1.1" 7082

So far I haven’t been able to find anything similar in the SDK.

Thanks

Never mind. I found post, “Dumping persistence record table for a VS”, which should be all that I need.

Well, I thought that I could figure it out on my own, but I’m not there yet. Could someone show me a sample of c code to make this call? Thanks.

Here is where I am stuck:

private void b_persistence_Click(object sender, EventArgs e)

{

string vsname, vsaddress;

long vsport;

vsname = “Bolifo_COMM_PL4-12340”;

vsaddress = “10.10.210.210”;

vsport = 12340;

iControl.LocalLBVirtualServer[][] virt_serv = new iControl.LocalLBVirtualServer[1][];

iControl.CommonVirtualServerDefinition[][] vs_def = new iControl.CommonVirtualServerDefinition[1][];

vs_def[0] = new iControl.CommonVirtualServerDefinition[1];

vs_def[0][0] = new iControl.CommonVirtualServerDefinition();

vs_def[0][0].name = vsname;

vs_def[0][0].address = vsaddress;

vs_def[0][0].port = vsport;

string[] vsname1 = new string[] { vsname };

iControl.LocalLBPersistenceMode vs_persmode = iControl.LocalLBPersistenceMode.PERSISTENCE_MODE_DESTINATION_ADDRESS_AFFINITY;

iControl.LocalLBPersistenceRecord[][] persistence_records = new iControl.LocalLBPersistenceRecord[0][];

persistence_records = m_interfaces.LocalLBVirtualServer.get_persistence_record(vsname1, vs_persmode);

}

When compiling, I get the message “Argument ‘2’: cannot convert from ‘iControl.LocalLBPersistenceMode’ to ‘iControl.LocalLBPersistenceMode[]’”

When I try to declare vs_persmode as 'iControl.LocalLBPersistenceMode[], the compiler rejects that too. Please help.

The second parameter to get_persistence_record is a 1-d array of PersistenceMode’s, also, you have a bunch of extra variables in there you don’t need. The code can be reduced to this.

private void b_persistence_Click(object sender, EventArgs e)  
 { 
   string[] vsname1 = new string[] { "Bolifo_COMM_PL4-12340" }; 
   iControl.LocalLBPersistenceMode[] vs_persmodes =  
     new iControl.LocalLBPersistenceMode[]  
       { iControl.LocalLBPersistenceMode.PERSISTENCE_MODE_DESTINATION_ADDRESS_AFFINITY }; 
  
   iControl.LocalLBPersistenceRecord[][] persistence_records = 
     m_interfaces.LocalLBVirtualServer.get_persistence_record(vsname1, vs_persmodes); 
 }

Hope this helps…

-Joe

Yes - it compiles! Thanks Joe. What’s more, I think I may be starting to understand why it works.

When debugging and mousing over the persistence_records variable, I don’t see anything in it. Should I see the persistent connections at that point, or do I have to save it to a file or something?

Thanks Joe!!!

I also tried it from the pool perspective (LocalLBPool.get_persistence_record), and the variable returns empty. I don’t know what I should be seeing. I thought that it would be a table filled with all of the persistent connections (there are ~ 200). Please advise. Thanks.

The LTM that I was calling to was version 9.2.3.

I called to another LTM (version 9.3.1), and I get an XML error(There is an error in XML document (39, 51).) {“Instance validation error: ‘’ is not a valid value for CommonProtocolType.”}.

Joe, can you give me any guidance on this one?

OTS02, sorry for the delay, it’s been a hectic week.

I just ran the virtual server code against my 9.6 box and it’s working fine, although I didn’t do it with the pool interface. There should be values returned if you specify the correct persistence mode in the request and you actually have persistent connections of that type at the time of the request. If this method is not returning values for you then you’ll likely need to get in touch with product support as it looks like it’s a problem with the server code.

-Joe

Joe,

Concentrating on the 9.3.1 boxes, I notice that I only get the XML error when there are records to be pulled. When I make the call to the “standby” unit, I do not get the error - the record returns empty. But when I make the call to the “active” unit (which has persistent connections), I get the XML error.

I have made sure that my Visual Studio is up to date on patches, but that did not help either.

I have attached the detail of the XML error to the post. If you could glance at it, I would be much obliged.

I’m currently struggling with the same issue on TMOS 9.4.5 using the 9.6.0 and 10.0.0 iControl assemblies. Exact same exception regardless of using the pool or virtualserver method. If you don’t catch the exception the method will return nothing and your app will hum along as if nothing went wrong.

Here is the code:

string[] sVSList = new string[] { cbVSList.SelectedItem.ToString() }; 
  
             LocalLBPersistenceMode[] oLBPersistMode = new LocalLBPersistenceMode[] { LocalLBPersistenceMode.PERSISTENCE_MODE_NONE }; 
             // PERSISTENCE_MODE_NONE will cause it to return all types. 
             LocalLBPersistenceRecord[][] PulledPersistTable = new LocalLBPersistenceRecord[][] { }; 
             try 
             { 
                 PulledPersistTable = if_iControl.LocalLBVirtualServer.get_persistence_record(sVSList, oLBPersistMode); 
                 //PulledPersistTable = if_iControl.LocalLBPool.get_persistence_record(sVSList, oLBPersistMode); 
             } 
             catch (Exception e)  
             { 
                 MessageBox.Show(e.ToString()); 
             }

And attached is the offending HTTP return captured via Fiddler2. Please let me know if there is any other information I can provide.

Thanks kvondersaar

I did the try/catch, but the did not get the record populated, as you did. So, I am not sure I am having the exact same issue. I did as Joe instructed, and opened a support case - I will post their findings as they become available.

From Support:

Perry,

Our escalation engineer notes that the BIG-IP LTM returns about 82K of data to the client before the iControl application issues a TCP Reset to terminate the connection. He is able to retrieve persistence data via a perl script, which runs successfully against v9.3.1 and v9.4.5-HF2 systems. He plans to update his 9.3.1 system to HF2, to match your environment, and to write a Visual C 2005 test application with which to continue analysis. He also notes that his perl script is able to parse the XML data being returned -- which is essentially identical to the results in the tcpdump/ssldump captures.

I’ll continue updating you as I receive news. Thank you.

Respectfully,

Charles Curtis-Stanley | Senior Network Support Engineer

F5 Network Support

According to the escalation engineer:

> I’ve verified that the LTM is returning correctly formated XML data

> while with and without persistence information stored on the LTM. The

> customer’s packet traces also show that the application buffers the

> LTM response and after the data is feed to the XML parser, the XML

> parser claims that the returned data is invalid. The data in the

> customer’s traces are near identical to the XML output from my tests.

> Most likely the XML serializer is not able to parse the AoA which

> results in the error that they are seeing and if this is the case, this is a limitation of the XML serializer, not a fault of the product. The customer should verify that the XML serializer is able to handle the returned data.

The decrypted C511568.icontrol.txt file definitely shows well-formed XML being sent in response to the POST request that’s submitted to /iControl/iControlPortal.cgi, up to the point where the client system issues a RST response to terminate the TCP connection. I’m not sure what an “AoA” is, but it seems to be the case that the XML serializer used by Visual Studio is not a happy camper when it receives it.

Bottom line: this seems to be a Microsoft Visual Studio issue, not a BIG-IP LTM iControl problem.Respectfully,

f5 support has created an engineering hotfix (Hotfix-BIGIP-9.3.1-HF6-69.14-ENG) that can be applied on top of 9.3.1 HF6. This will be incorporated into HF7 for 9.3.1.

Installed the engineering hotfix, and am now able to pull persistence records with iControl. Thanks f5 Support! Thanks Joe!