Forum Discussion

Hank_Stallings's avatar
Hank_Stallings
Icon for Nimbostratus rankNimbostratus
Jun 19, 2015

iControl SNAT Pool list vs Web interface

I am trying to list the SNAT pools on an LTM via iControl and the list of pools is different from the SNAT Pool List on the BIG-IP web interface.

 

I am using the following code:

 

$user = 'myuser'
$password = 'mypass'
$F5 = 'MyF5'

-------------------------------------------------------------------------
function Do-Initialize()
-------------------------------------------------------------------------
{
  if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null )
  {
    Add-PSSnapIn iControlSnapIn
  }
  $success = Initialize-F5.iControl -HostName $F5 -Username $User -Password $password;

}

$SNATPools = (Get-F5.iControl).LocalLBSNATPool.get_list() -replace '/Common/',''
ForEach($pool in $SNATPools){
$poolmembers = (Get-F5.iControl).LocalLBSNATPool.get_member($pool)
ForEach($member in $poolmembers){
"$pool," + ($member -join ",")
}
}

This provides 2 SNAT Pools.

 

The web interface lists 30 and they don't include the two that come back from the PowerShell script.

 

I know I must be missing something, but I can't determine what I'm not doing right.

 

Thanks in advance!

 

Hank

 

  • The LocalLBSNATPool.get_list() should return the full list. The only thing I can think of is that iControl by default only queries the objects in the current folder. You can override that by setting the recursive query state flag with the System.Session.set_recursive_query_state() method. I highlighted that in my article on iControl folders

     

    I'll do some testing and see if I can recreate your issue.

     

    -Joe