Forum Discussion

Jay_Allison_400's avatar
Jay_Allison_400
Icon for Nimbostratus rankNimbostratus
Aug 09, 2005

Finding which virtuals are associated with a pool

So, at the end of the day I want to be able to create a perl script that allows me to enter a member IP address and it to return to me which pools and virtuals it belongs to.

 

 

There is an easy way to do this with pools with the 'node -> get_pool_membership' method, but there doesn't seem to be any corresponding method to take a pool and find out what virtuals it is associated with.

 

 

I can brute force this by listing all pools for a virtual and then sorting for the relevant pool, but I was hoping for a much easier and more elegant way to handle this.

 

 

I am also a bit worried about being able to brute force the pools out of rules as well.

 

 

Thoughts?

2 Replies

  • Unfortunately on 4.x there is no method that takes as a parameter a pool and returns the virtuals that it's a member of. Your only course of action right now is to list out all the virtuals, call the LocalLB::VirtualServer::get_pool() method to return the pool for each virtual, and compare the pools. If a match occurs, then you know it's contained within the Virtual.

    As for the pools from Rules, I do have something to help you with there. You can use the LocalLB::Rule::get_pool_associations() method to return the pools associated with the given rule

    String [][] ITCMLocalLB::Rule::query_pool_associations
    (
      in ITCMCommon::StringSequence rule_names
    );

    This method has been available since BIG-IP v4.5.

    -Joe
  • bknotwell_12713's avatar
    bknotwell_12713
    Historic F5 Account
    Hi Jay--

     

     

    It appears you're right--you'll need to query all the vips first and then walk them. Unfortunately, the get_pool and get_rule methods don't take IPPortDefinitionSequence. However, it's not entirely rough since the Rule interface's query_pool_associations method takes a list of rule_names as input.

     

     

    Good luck!

     

     

    --Brad