# GTM Pools

**URL:** <https://community.f5.com/t/gtm-pools/47001>\
**Category:** Technical Forums\
**Tags:** icontrol, dev, devops\
**Created:** [December 22, 2008, 3:59pm UTC](https://community.f5.com/t/gtm-pools/47001 "2008-12-22T15:59:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![omniplex](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omniplex](https://community.f5.com/u/omniplex)\
**Post date:** [December 22, 2008, 3:59pm UTC](https://community.f5.com/t/gtm-pools/47001/1 "2008-12-22T15:59:15Z")

</div>

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:

```tcl
@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.

---

<div class="post-metadata">

**Author:** ![Joe\_Pruitt](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/joe_pruitt/32/8438_2.png) [@Joe\_Pruitt](https://community.f5.com/u/Joe_Pruitt)\
**Post date:** [December 23, 2008, 6:43am UTC](https://community.f5.com/t/gtm-pools/47001/2 "2008-12-23T06:43:57Z")

</div>

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

```tcl
@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:

```tcl
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

---

<div class="post-metadata">

**Author:** ![omniplex](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omniplex](https://community.f5.com/u/omniplex)\
**Post date:** [January 5, 2009, 4:55pm UTC](https://community.f5.com/t/gtm-pools/47001/3 "2009-01-05T16:55:02Z")

</div>

Unfortunately that didn’t work either.

Here is the SOAP request

```tcl
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:

```tcl
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.

---

<div class="post-metadata">

**Author:** ![Joe\_Pruitt](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/joe_pruitt/32/8438_2.png) [@Joe\_Pruitt](https://community.f5.com/u/Joe_Pruitt)\
**Post date:** [January 5, 2009, 9:24pm UTC](https://community.f5.com/t/gtm-pools/47001/4 "2009-01-05T21:24:12Z")

</div>

It looks as if it should work. I just tested it with this code

[http://devcentral.f5.com/wiki/default.aspx/iControl/PerlGTMPool.html](http://devcentral.f5.com/wiki/default.aspx/iControl/PerlGTMPool.html)

[Click here](http://devcentral.f5.com/wiki/default.aspx/iControl/PerlGTMPool.html)

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:

```tcl
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

---

<div class="post-metadata">

**Author:** ![omniplex](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omniplex](https://community.f5.com/u/omniplex)\
**Post date:** [January 7, 2009, 2:08pm UTC](https://community.f5.com/t/gtm-pools/47001/5 "2009-01-07T14:08:20Z")

</div>

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.
