Forum Discussion

Les_Marstaeller's avatar
Les_Marstaeller
Icon for Nimbostratus rankNimbostratus
Feb 01, 2006

Irules changing BigIP configs?

Is it possible to disable a pool member using an irule (and then subsequently re-enable it)?

 

 

The reason I ask is that we have a pool that has 2 x FTP servers in it. We would like to direct all requests to the one server, and then "failover" to the second FTP server if the first one fails. If the first server then comes back up, we do not want that used unless the second server fails. Very similar to the failover function the BigIP's use themselves in HA Mode if an ACTIVE/STANDBY preference isn't set.

 

 

Thanks for your help,

 

 

Les

 

Canberra, Australia
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hi Les --

     

     

    that can't be accomplished within an iRule, but an iControl application or a custom scripted external monitor could be crafted to accomplish that goal. It requires a 2-member pool with priority on both nodes set > 1, one higher than the other, and a built-in monitor for the ftp service applied to both nodes. Either solution would monitor the node status changes, and swap priority when the active server goes down. The F5 Consulting team is available for hire for projects like that. If you'd like further assistance, you can contact us at consulting@f5.com.

     

     

    deb allen

     

    f5 networks consulting
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Actually, that's not quite true Deb.

    One could disable a pool member from within an iRule with the LB::down LB::up commands added in 9.2. You just need to be aware that the monitors will still continue to think that the pool member is up, though the pool member will not be picked. More work in this area is coming in a subsequent release.

    Also, I think you could accomplish what Les wants to do with something like this:

    
    when RULE_INIT {
       set ::active_FTP 10.0.0.1
       set ::backup_FTP 10.0.0.2
    }
    when CLIENT_ACCEPTED {
       pool FTP_pool member $::active_FTP 21
    }
    when LB_FAILED {
       if { [LB::status pool FTP_pool member $::backup_FTP 21] eq "up" } {
          set temp $::active_FTP
          set ::active_FTP $::backup_FTP
          set ::backup_FTP $temp
          pool FTP_pool member $::active_FTP 21
       }
    }

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Oh BTW, that should be:

    LB::reselect pool FTP_pool member $::active_FTP 21

    at the bottom of the LB_FAILED event. Sorry about that.
  • Thanks for the reply everyone.

     

     

    I have tried the irule that you kindly wrote for me unRuleY but it is coming up with an undefined procedure for LB::status (line 9)

     

     

    We are using version 9.1.0 (build 6.2). Is this procedure defined in our build?

     

     

    Thanks,

     

     

    Les

     

    Australia
  • LB::status was introduced in BIG-IP v9.2.0. You'll have to upgrade if you want to have access to that command.

     

     

    If you have a question versioning in the future, we've included which release each command was introduced in our wiki documentation.

     

     

    Here's the link for the LB::status command.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LB__status.html

     

    Click here

     

     

    -Joe
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    You could also just take the if test out. I was just checking if the backup member is up before switching to it. You could just blatantly switch the servers on any LB_FAILED.

     

  • Thanks so much for all of your expert help. This forum continues to impress with the very knowledgable people that are members of it.

     

     

    Les

     

    Australia