Forum Discussion

4 Replies

  • Hi!

    With Powershell:

    if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null ){
        Add-PSSnapIn iControlSnapIn
    }
    
    Setup Credentials
    $user = 'user'
    $pass = 'password'
    
    Define the LB you want to check
    $bigipname = "10.10.0.1"
    $loadbalancername = "MY-LB"
    
    Initialize dictionary for caching pools
    $poolpartdict = @{}
    
    Connecto to the F5
    $success = Initialize-F5.iControl -HostName $bigipname -Username $user -Password $pass;
    $f5 = Get-F5.iControl
    
    Get the partition list
    $f5partitions = $f5.ManagementPartition
    $partitionlist = $f5partitions.get_partition_list()
    
    Go through each partition
    $partitionlist | foreach-object {       
    
        $partition = $_.partition_name
        $f5partitions.set_active_partition($partition)
    
        $poollist = $f5.LocalLBPool.get_list()
    
        Save the pools + partition in the dictionary
        $poollist | ForEach-Object {
            $poolpartdict.Add($_, $partition)
        }   
    }
    
    The pool partitions are now cached and you print the partition like this:
    $poolpartdict["mypool"]
    

    Good luck!

    /Patrik

  • Thank you Patrik. There is one problem. I have to travel all the partitions to get the pool list when I just want to get the partition of one pool(not cached).Is there a method to do that thing for me?

     

    • Patrik_Jonsson's avatar
      Patrik_Jonsson
      Icon for MVP rankMVP
      No problem! Sorry, there is no such thing. I've also been looking for a "All (Read only)" type of partition but as of yet there is no such thing. I could write a function which would do it for you but it would be as fast for one lookup but much slower if you want to do several lookups as the information would not be cached as in the first example. Let's put it like this. Why do you want to know the partition of a pool? /Patrik
    • bes_newer_14056's avatar
      bes_newer_14056
      Icon for Nimbostratus rankNimbostratus
      I just want to modify the pool, but if I don't know the partition, I can't modify it. I'm using BIG-IP v10.1.0