Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Pool member control issue when non-default partition is used

Hi, I use script from https://devcentral.f5.com/wiki/iControl.PsPoolMemberControl.ashx. My problem is when I call function Disable-Member, I get error 16908336. I run this script command by command and found out that command "$MemberStatisticsA = (Get-F5.iControl).LocalLBPoolMember.get_statistics( (, $pool_name), $MemberDefAofA);" generates error when I am using non-default partition. All another functions seems to be fine. Do you have any idea why it is so?

Thanks, Zdenek Image Text

2
Rate this Question
Comments on this Question
Comment made 15-Oct-2013 by Matthew Harris 11
Hi Zdenda, I have had a call open with F5 for over 3 weeks now for this exact same problem. Anything outside the Common partition does not work when attempting to get statistics. This is true even when using I ensure that the current active system folder is set to the partition I need it to be using (Get-F5.iControl).SystemSession.get_active_folder() If you hear back please post it. Thank you.
0
Comment made 22-Oct-2013 by Eugene Reznik 90
This sounds like a bug. Can someone from F5 confirm if/when it will get fixed?
0
Comment made 18-Jun-2015 by THM 1
I have the same issue. Is it fixed in new version of iControl and/ot F5 ?
0
Comment made 18-Jun-2015 by THM 1
I have the same issue. Is it fixed in new version of iControl and/ot F5 ?
0

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi Guys,

I don't use Powershell, but I do use the same .NET Assembly (I program C#) and I was able to get it to work.

Image Text

This is the call that I made:

LocalLBPoolMemberMemberStatistics[] stats = f5Interfaces.LocalLBPoolMember.get_statistics(new[] { poolname }, new[] { memberarrylist.ToArray() });

The input that it wants is an Array of Pools and a Multi-Dimensional Array of Pool Members (CommonIPPortDefinition).

Hope this helps.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi,unfortunatelly this issue still persists. I tried some parts of this script.

But this "get_all_statistics" command is not working when I am not in Common partition.

$PoolList = (Get-F5.iControl).LocalLBPool.get_list() | Sort-Object;
$MemberStatisticsA = (Get-F5.iControl).LocalLBPoolMember.get_all_statistics($PoolList)

Is it possible that it is something wrong with F5 and we have to wait for fix? I use version 11.3.0 HF7

Thanks, Zdenek

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Ah....Based on what you were using in your Powershell Script I assumed that you were running on v10.x.x. The PoolMember method has been deprecated.

Image Text

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Yep, screen in first post was from lab where I run version 10.2.x, so it was related to partition. But then I continued in version 11.x.x so it was really related to version.

Anyway, I corrected code, so it is 11.xx friendly and I am back in partition problem (the same error code 16908336 (0x01020030) as in the first post). Here is the full code:

(Get-F5.iControl).ManagementPartition.set_active_partition( ( ,"MyPartition"))
$pool_name = "lipe_pool"
$member = "10.147.140.61:80"

$vals = $member.Split( (, ':'));
$member_addr = $vals[0];
$member_port = $vals[1];

$MemberDef = New-Object -TypeName iControl.CommonAddressPort;
$MemberDef.address = $member_addr;
$MemberDef.port = $member_port;
$MemberDefAofA = New-Object -TypeName "iControl.CommonAddressPort[][]" 1,1
$MemberDefAofA[0][0] = $MemberDef;

$MemberStatisticsA = (Get-F5.iControl).LocalLBPool.get_member_statistics( (, $pool_name), $MemberDefAofA);

And here is the result when I try the last command: Image Text

I am really trying to find solution for that, but still not successful. Is it really something bad in F5, or do I miss something still? Thanks a lot, Zdenek

0
Comments on this Answer
Comment made 24-Oct-2013 by Zdenda 445
Interesting is that this command runs without problems and it uses the same definitions: (Get-F5.iControl).LocalLBPool.add_member_v2( (, $pool_name), $MemberDefAofA);
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Even if you have switched to the correct partition you still need to specify the partition for both the server and the pool in your code.

    (Get-F5.iControl).ManagementPartition.set_active_partition( (,"PARTITION_NAME") )
Write-Host (Get-F5.iControl).ManagementPartition.get_active_partition() -ForegroundColor Yellow
  $address = New-Object -TypeName iControl.CommonAddressPort;
  $address.address ="/PARTITION_NAME/SERVER_NAME"
  $address.port = 666;

    $MemberStatisticsA = (Get-F5.iControl).LocalLBPool.get_member_statistics( ("/PARTITION_NAME/POOL_NAME"), $address);
      $MemberStatisticEntry = $MemberStatisticsA[0].statistics[0];
    $Statistics = $MemberStatisticEntry.statistics;
    foreach ($Statistic in $Statistics)
    {
      $type = $Statistic.type;
      $value = $Statistic.value;

      if ( $type -eq "STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS" )
      {
        # just use the low value.  Odds are there aren't over 2^32 current connections.
        # If your site is this big, you'll have to convert this to a 64 bit number.
        $cur_connections = $value.low;
        Write-Host "Current Connections: $cur_connections"
      }
    }
0
Comments on this Answer
Comment made 24-Oct-2013 by Zdenda 445
Ah, you was quicker then me, I noticed it's missing in the code above by mistake. Now there is actuall code, error is the same
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Zdenda, if you still getting an error can you post your code? I'll see if i can spot an issue.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi, the code is mentioned above your code (last my post where is also printscreen attached). Anyway, I tried also your code and the result is still the same (I run v11.3)..

(Get-F5.iControl).ManagementPartition.set_active_partition( (,"MyPartition") )

$address = New-Object -TypeName iControl.CommonAddressPort;
$address.address ="/MyPartition/10.147.140.61"
$address.port = 80;

$MemberStatisticsA = (Get-F5.iControl).LocalLBPool.get_member_statistics( ("/MyPartition/lipe_pool"), $address);
0
Comments on this Answer
Comment made 24-Oct-2013 by Eugene Reznik 90
Try using the server name instead of the IP address. I had an issue with using the IP. Also the case matters.
0
Comment made 24-Oct-2013 by Zdenda 445
name is 10.147.140.61%1, so I used this: $address.address ="/MyPartition/10.147.140.61%1" and I got this: Exception calling "get_member_statistics" with "2" argument(s): "There is an error in XML document (226, 74)." At line:1 char:73 + $MemberStatisticsA = (Get-F5.iControl).LocalLBPool.get_member_statistics <<<< ( ("/MyPartition/lipe_pool"), $address); + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
0
Comment made 29-Oct-2013 by Zdenda 445
Ok, this was solved by IcontrolSnapin reinstalation. I don't know if I had old version or if it was corrupted or something like that
0
Comment made 26-Nov-2013 by lbaldwin123 0
I had a problem with the code above. Running iControl 11.2 with against BIG-IP 11.3.0 Build 3144.0 Hotfix HF8. I was only able to get this working by removing the partition from the $address.address. (Get-F5.iControl).ManagementPartition.set_active_partition( (,"dev") ) $address = New-Object -TypeName iControl.CommonAddressPort; $address.address = "SERVERNAME" $address.port = 80; $MemberStatisticsA = (Get-F5.iControl).LocalLBPool.get_member_statistics( ("/dev/poolname"), $address); $MemberStatisticEntry = $MemberStatisticsA[0].statistics[0]; $Statistics = $MemberStatisticEntry.statistics; foreach ($Statistic in $Statistics) { $type = $Statistic.type; $value = $Statistic.value; if ( $type -eq "STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS" ) { # just use the low value. Odds are there aren't over 2^32 current connections. # If your site is this big, you'll have to convert this to a 64 bit number. $cur_connections = $value.low; Write-Host "Current Connections: $cur_connections" } } hope this helps
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Any lucky guys? I still have the same issue. Seems it is never resolved in F5 devcentral.

0