Forum Discussion

omniplex's avatar
omniplex
Icon for Nimbostratus rankNimbostratus
Dec 22, 2008

GTM Pools

Is there a trick to disabling a GTM pool used by a wide IP?

 

 

I can enable them just fine when they have been manually disabled, but for some reason the iControl interface just ignores the disable state and nothing happens.

 

 

Here is copy of the code in question:

 

 

  
    
  @gtmPools = ('prod1','prod2','prod3','prod4');  
  @gtmEnabled=(1,1,1,1);  
  @gtmDisabled=(0,0,0,0);  
    
          $gtm = SOAP::Lite  
                  -> uri('urn:iControl:GlobalLB/Pool')  
                  -> proxy("https://$gtmHost:443/iControl/iControlPortal.cgi");  
          eval { $LBVirtual->transport->http_request->header  
          (  
                  'Authorization' =>  
                  'Basic ' . MIME::Base64::encode("$sUID:$sPassword", '')  
          ); };  
    
          $soapResponse = $gtm->set_enabled_state(  
                  SOAP::Data->name(pool_names => [@gtmPools]),  
                  SOAP::Data->name(states => [@gtmDisabled])  
          );  
          @gtmStatus = @{$soapResponse->result};  
    
  

 

 

The only difference between enable and disable code is the variable @gtmEnabled is used instead.

 

 

EDIT: I guess it would help to mention that this is perl.

4 Replies

  • In V9, you'll have to use the string literals for the enumeration types. So, your code should look like this:

     

     

    @gtmEnabled = ('STATE_ENABLED', 'STATE_ENABLED', 'STATE_ENABLED', 'STATE_ENABLED'); 
     @gtmDisabled = ('STATE_DISABLED', 'STATE_DISABLED', 'STATE_DISABLED', 'STATE_DISABLED');

     

     

    That's assuming that your code will create an array. I usually work through Perl by trail and error and I don't have access to my dev machine right now.

     

     

    If that doesn't work, this should:

     

     

    my @gtmPools; 
     push @gtmPools, "prod1"; 
     push @gtmPools, "prod2"; 
     push @gtmPools, "prod3"; 
     push @gtmPools, "prod4"; 
      
     my @gtmEnabled; 
     push @gtmEnabled, "STATE_ENABLED"; 
     push @gtmEnabled, "STATE_ENABLED"; 
     push @gtmEnabled, "STATE_ENABLED"; 
     push @gtmEnabled, "STATE_ENABLED"; 
      
     my @gtmDisabled; 
     push @gtmDisabled, "STATE_DISABLED"; 
     push @gtmDisabled, "STATE_DISABLED"; 
     push @gtmDisabled, "STATE_DISABLED"; 
     push @gtmDisabled, "STATE_DISABLED";

     

     

    Hope this helps...

     

     

    -Joe

     

  • Unfortunately that didn't work either.

    Here is the SOAP request

       xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"  
       xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
       xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
       xmlns:xsd="http://www.w3.org/1999/XMLSchema"  
       SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">  
        
        
        
      prod1  
      prod2  
      prod3  
      prod4  
        
        
      STATE_DISABLED  
      STATE_DISABLED  
      STATE_DISABLED  
      STATE_DISABLED  
        
        
        
      

    And the response from the GTM:

              xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"  
              xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"  
              xmlns:s="http://www.w3.org/2001/XMLSchema-instance"  
              xmlns:y="http://www.w3.org/2001/XMLSchema"  
              xmlns:iControl="urn:iControl"  
              E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">  
        
                xmlns:m="urn:iControl:GlobalLB/Pool">  
        
      

    Everything set to disabled is still enabled though.
  • It looks as if it should work. I just tested it with this code

     

     

    http://devcentral.f5.com/wiki/default.aspx/iControl/PerlGTMPool.html

     

    Click here

     

     

     

    In this code I'm only passing in a single pool, but I tested by adding multiple pools manually in the code and it worked fine.

     

     

    Here's the SOAP Trace for the set_enabled_state:

     

     

      
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"   
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"   
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">  
        
          
            
            gtm_pool  
            
            
            STATE_DISABLED  
            
          
      

     

     

    Can you run this script against your BIG-IP. If you pass in no pool name, it will return a list. Here's a test run I ran:

     

     

    > .\PerlGTMPool.pl bigip 443 user pass

     

    gtm_pool_2

     

    gtm_pool

     

    > .\PerlGTMPool.pl bigip 443 user pass gtm_pool

     

    STATE_ENABLED

     

    > .\PerlGTMPool.pl bigip 443 user pass gtm_pool disabled

     

    STATE_DISABLED

     

    > .\PerlGTMPool.pl bigip 443 user pass gtm_pool enabled

     

    STATE_ENABLED

     

    > .\PerlGTMPool.pl bigip 443 user pass gtm_pool

     

    STATE_ENABLED

     

     

     

    If this still isn't working then this looks like a bug on your BIG-IP but I'm unaware of an open issue on this. Let me know what you find out.

     

     

    -Joe
  • Well, I ran your script which worked.

     

    I then changed the SOAP line at the top so I can get the XML output.

     

     

    Without making any modifications I ran mine to get the XML output and compare, and for some reason it's now working.

     

     

    This is puzzling and slightly unreliable at the moment.

     

     

    I'm going to have to keep an eye on this.