Forum Discussion

Joao_Carmona_41's avatar
Joao_Carmona_41
Icon for Nimbostratus rankNimbostratus
Jan 20, 2011

List Partitions Virtual Servers

Hi Joe,

 

 

I just installed the powershell icontrolSnapin and all the common commands works fine. My problem is that my Big-Ip device have 5 partitions (plus the common), and all Virtual Servers are in that 5 partitions.

 

 

I can get/list the partitions, but i didn't figured out how to get the virtual servers from that partitions.

 

 

For listing the partitions i'm using:

 

 

(Get-F5.iControl).ManagementPartition.get_partition_list();

 

 

I was looking on the icontrol samples for some help, and the PS Partition Access Sample caught my attention:

 

 

(Get-F5.iContro).ManagementPartition.set_active_partition("Partition1");

 

 

If i activate a partition, when I do a list Pools, i'm going to get the ones from that partition (Partition1)?

 

 

(Get-F5.iControl).LocalLBPool.get_list();

 

 

This is a production environment, so I don't want to mess the things Up.

 

 

 

One final Note, you should include the http://devcentral.f5.com/wiki/default.aspx/iControl/PowerShellSetupSnapin.html, on the setup/install file. It works pretty well on Windows 2008 R2.

 

 

 

Best Regards,

 

João Carmona

 

2 Replies

  • You are using the right logic. A call to set_active_partition() will change the context to the specified partition for the current user. This value is a persistent server side value that stays constant until a LTM restart. So, you should only have to call it once before making your calls for that specific partition.

     

     

    The one thing you didn't specify, so I'll make sure you are aware of it. You can call the get_user_permission() method in the Management.UserManagement interface to get a list of partitions the current user has access to and what their role is for that given partition. This way you can determine which partition from the values returned from the get_partition_list() method you have rights to access.

     

     

    Let me know if this doesn't make sense...

     

     

    -Joe

     

  • Thanks Joe, it makes a lot of sense.

     

     

    It worked, but I a strange behavior (or i think is strange). It's a smal thing.

     

     

    For testing I created a new user, and gave him Manager role in only onePartition. Through the webUI, i can only see that only that partition, but in powershell i can list all the Partitions. In fact my active partition was the "Common". Is this normal?

     

     

     

    Regarding my problem:

     

     

    I used the set_active_partition to set the partition that I want to work it. Than I was able to list all the Partition Pool list, all Partition Virtual Servers... well until now i can see everything from the desire partition.

     

     

    Thank you for your help.

     

    João Carmona