Forum Discussion

Brooke_Gravitt_'s avatar
Icon for Nimbostratus rankNimbostratus
Nov 16, 2011

LocalLB::Pool::create - How to create a pool ala bigpipe




I'm trying to use the SOAP API to replace some bigpipe commands. Currently, we're automagically configuring the BIG-IP for environments at order time with our custom private cloud. Our automated process currently ssh's to the F5 and runs specific bigpipe commands depending on what configuration the customer orders ( pools, members, SSL, iRule versions, etc. ) For example, we loop through creating all the base elements based on a stored DB config for an "environment"




As such, we've got some singleton commands ( in this case, an empty pool. )






bigpipe pool $BigIpCreatePool.PoolName { monitor all tcp }




Multiple calls to this based on how many pools this env should have ( e.g. select bigIPPoolName from bigIPEnvConfig; might return 3 pools for env type A, and 7 for env type B.)




I'd like to do the same using a soap call to ( iControl )LocalLB::Pool::create.




I can, if I specify pool members at creation time:




--- well, it seems you can't embed XML here. Rats! ---




soap:Envelope soap:encodingStyle="" xmlns:xsi="" xmlns:soapenc="" xmlns:xsd="" xmlns:soap=""




create xmlns="urn:iControl:LocalLB/Pool"


pool_names soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"


item xsi:type="xsd:string"scooby_doo/item




lb_methods soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"


item xsi:type="xsd:string"LB_METHOD_ROUND_ROBIN/item




members soapenc:arrayType="soapenc:Array[1]" xsi:type="soapenc:Array"


item soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array"




address xsi:type="xsd:string"


port xsi:type="xsd:int"8080/port
















I can't see a way to create just an empty pool - we'll be looping through adding the members later, some of the process is asynchronous - I may or may not know the complete list of nodes up front, due to the existing automated process ( and some external integration points. )



3 Replies

  • George_Watkins_'s avatar
    Historic F5 Account

    Hi Brooke,




    I can't tell which SOAP library you're using so I'll give a couple different examples. There is an example written in Perl in the CodeShare: Perl Create Pool. If you're into Ruby, you can download the Ruby Library, install it (or just 'gem unpack' to extract the contents), and locate a sample script called 'create-http-virtual-and-pool.rb' in the 'examples' folder. That script is full of sanity checking goodies that will make your life easier.






  • HI! Thanks for the reply. It isn't that I can't create a pool ( the SOAP XML in my post works just fine. )



    BTW, I am not using *ANY* of the libraries, we'll be communicating directly with iControl from an ESB via SOAP.




    The question is how can I create just an *empty* pool. The iControl SOAP API is expecting




    -Pool Name


    -Load Balancing Type


    -Member List ( [ Member IP, Port ] )




    I'd like to create the pools, empty, as we do now ( via bigpipe,) and add the members later. If it's not possible, I'll have to add a dummy pool member and remove it later.







  • To create a pool with no members, you'll just need to pass in the following parameters



    string [] pool_names - array size 1 with the value of the pool name


    LBMethod [] lb_methods - array size 1 with value of lb method


    IPPortDefinition[][] members - 2-d array with 1st degree of size 1 (for the supplied pool) an the second degree with size 0 (for no members).



    This can be done with the following perl code:



    push @memberDefAofA, [@memberDefA];
    $soapResponse = $Pool->create(
      SOAP::Data->name(pool_names => [$sPool]),
      SOAP::Data->name(lb_methods => ["LB_METHOD_ROUND_ROBIN"]),
      SOAP::Data->name(members => [@memberDefAofA])



    This will result in the following SOAP message (with angle brackets replaced by brackets)



        [create xmlns="urn:iControl:LocalLB/Pool"]
          [pool_names soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"]
            [item xsi:type="xsd:string"]foopool[/item]
          [lb_methods soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array"]
            [item xsi:type="xsd:string"]LB_METHOD_ROUND_ROBIN[/item]
          [members soapenc:arrayType="soapenc:Array[1]" xsi:type="soapenc:Array"]
            [item soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array" /]



    Hope this helps...