Forum Discussion
bes_newer_14056
Nimbostratus
Mar 07, 2014How can I get the partition of a pool using IControl?
The version of BIG-IP is 10.1.0. Which method can I use?
Mar 07, 2014
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects