Forum Discussion

Angelo's avatar
Angelo
Icon for Nimbostratus rankNimbostratus
Feb 12, 2013

error on I-rule

Hi

 

I got this irule but i keep getting a error when i try to create it, this is on V11.1

 

 

 

when HTTP_REQUEST {

 

if {[active_members [LB::server pool_OMS_test]] < 1} {

 

pool pool_OMS_test2

 

Stop processing the iRule for this event here

 

return

 

}

 

}

 

 

error

 

 

[invalid keyword "pool_OMS_test" must be: addr name route_domain pool port priority ratio weight ripeness ] [pool_OMS_test]

 

 

4 Replies

  • I saw a good point elsewhere that it's better to have no default Pool on the VS because if the default Pool fails and the VS goes down, the iRule won't trigger and the second Pool won't be used. With no default Pool the rule would look like this;

    
    when HTTP_REQUEST {
     If the preferred Pool DOES have Members
     if {[active_members [LB::server primary_pool_name]] > 0} {
      Use the preferred Pool
      pool primary_pool_name
      Stop processing the iRule for this event here
      return
     }
     else {
      Otherwise, use the secondary, back-up Pool
      pool secondary_pool_name
     }
    }
    
  • Hi Steve,

    I don't think that's fully accurate. If you have an iRule enabled on a virtual server that's marked down because the default pool is down, the iRule should still be triggered. Here's a quick test on 11.3:

    
    HTTP request to the VS marked down gets a response:
    
     curl -I 10.1.0.120
    HTTP/1.0 200 OK
    a_header_name: a_header_value
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 109
    
    VS shows down because default pool is marked down:
    
    [root@ve11d:Active:Changes Pending] config  tmsh show ltm virtual ve11_10.1.0.120_http_vs
    
    ------------------------------------------------------------------
    Ltm::Virtual Server: ve11_10.1.0.120_http_vs
    ------------------------------------------------------------------
    Status
      Availability     : offline
      State            : enabled
      Reason           : The children pool member(s) are down
      CMP              : enabled
      CMP Mode         : all-cpus
      Destination      : 10.1.0.120:80
    
    
    List of virtual definition:
    
    [root@ve11d:Active:Changes Pending] config  tmsh list ltm virtual ve11_10.1.0.120_http_vs
    ltm virtual ve11_10.1.0.120_http_vs {
        destination 10.1.0.120:http
        ip-protocol tcp
        mask 255.255.255.255
        pool ubuntu_1ip_port80_pool
        profiles {
            a_tag_html { }
            http { }
            oneconnect { }
            tcp-lan-optimized { }
        }
        rules {
            http_response_by_uri_rule
        }
        security-log-profiles {
            "Log illegal requests"
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vlans-disabled
    }
    

    Aaron
  • That's a very nice way of saying I'm wrong =] Thanks, I'll make a note of that. Cheers