Forum Discussion

Ajmal_2608's avatar
Ajmal_2608
Icon for Nimbostratus rankNimbostratus
Feb 02, 2013

Getting errors while upgrading from 10.x to 11.x

Issue:

 

We were getting errors with the existing configuration, after migrating to 11.2.1 some syntax errors, probably in the irules. The one I noticed is the keyword "na1esbapppool".

 

 

The configuration in 10.2 is

 

 

class na1webpppool{

 

network 10.22.0.0/16

 

}

 

 

Snippet of the iRule in HTTP_REQUEST

 

--------------------------------------------------------

 

 

if { not [matchclass [IP::client_addr] equals $::na1webpppool] } {

 

if { [URI::decode [string tolower [HTTP::uri]]] matches_regex "^/webdilb*" } {

 

log local0. "URI requested = [HTTP::uri] by [IP::client_addr] blocked"

 

HTTP::respond 404 content "ERROR 404Not Found

 

The requested URL was not found on this server." noserver

 

}

 

}

 

 

 

Upgrade Requirement

 

H/w - BIG-IP 6900

 

Current version: - BIG-IP Version 10.2.2 969.0

 

Required Version: - Hotfix-BIGIP-11.2.1-1042.0-HF3

 

 

Please suggest what can be done. Is there any utility for converting the 10.2 config to 11.2 in advance?

 

Is there a tool which will check the syntax of the iRule compatible to 11.2?

 

Thanks in advance

 

- Ajmal

 

8 Replies

  • Looks like the $:: was creating a problem

     

     

    https://devcentral.f5.com/wiki/iRules.class.ashx

     

     

    However I still have a question:

     

     

     

    Existing Code snippet of iRule

     

    ------------------------------------------

     

    when RULE_INIT {

     

    set safe_http_methods [list "GET" "PUT" "DELETE" "POST" "HEAD" "OPTIONS"]

     

    }

     

     

    when HTTP_REQUEST {

     

    if { ![matchclass [HTTP::method] equals $::safe_http_methods] } {

     

    set trafficLog "$trafficLog REJECTED:badMethod"

     

    HTTP::respond 302 noserver Location "https://[HTTP::host]/error/error.html"

     

    }

     

    }

     

     

     

    Modified for 11.x

     

    ----------------------------

     

     

    when RULE_INIT {

     

    set safe_http_methods [list "GET" "PUT" "DELETE" "POST" "HEAD" "OPTIONS"]

     

    }

     

     

    when HTTP_REQUEST {

     

    if { ![class match -- [HTTP::method] equals $safe_http_methods] } {

     

    set trafficLog "$trafficLog REJECTED:badMethod"

     

    HTTP::respond 302 noserver Location "https://[HTTP::host]/error/error.html"

     

    }

     

    }

     

     

    Will this work in 11.x as it is working fine in 10.2 ?

     

     

     

    Also can I change the variable "safe_http_methods" to a "Data-Group" of some type like a "list" or "array" (if that is available in LTM) and use the same code? i.e.

     

     

    if { ![class match -- [HTTP::method] equals $safe_http_methods] } {

     

    set trafficLog "$trafficLog REJECTED:badMethod"

     

    HTTP::respond 302 noserver Location "https://[HTTP::host]/error/error.html"

     

    }

     

     

     

    Please suggest

     

     

    -Ajmal

     

  • Jnon's avatar
    Jnon
    Icon for Nimbostratus rankNimbostratus
    You should upload your 10.2 code it iHealth, I think you'll find that it would warn you about the use of $:: that changed from version 9 to version 10, as you won't be able to take advantage of CMP with the use of the $:: - however the irule will work. Sounds like v11 might not allow it at all...

     

     

    Yes you can use the variable as a string and create a class out of it, that is the better way to go for sure.

     

     

     

  • I don't have any idea about iHealth, it looks like an Enterprise manager component. If it is the we do not have that.

     

     

    Any other options?
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    iHealth is a web interface as well as being used by EM. Just upload your qkview to it and away you go.

     

     

    H
  • We do not have EM in our environment, also all the HA pairs are on 10.2.

     

     

    Where can I find the iHealth option, is it a free control ? Please suggest
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus

     

     

    https://ihealth.f5.com/qkview-analyzer/

     

     

    You probably need an active support contract, but apart from that it's free.

     

     

    H
  • Thanks a lot, that what I was looking at. I'll check the same and try finding the issue.

     

     

    P.S: Yes we do have active support contract for the said HA pair

     

  • I did use the qkview-analyzer, but looks like it doesnn't look in the iRULEs' code.

     

     

    Is there any way I can use my 10.2 config and verify what errors/incompatibility it has for getting migrated to 11.x ? (I don't have any box running 11.x all are 10.x)