Forum Discussion

Wade_98751's avatar
Wade_98751
Icon for Nimbostratus rankNimbostratus
Oct 08, 2008

LB::up command is not working properly

Moving this thread off of the iControl forum and onto iRule forum since the thread changed from being solved via iControl to being solved via iRule per DevCentral's recommendation.

 

 

http://devcentral.f5.com/Default.aspx?tabid=53&forumid=1&postid=26906&view=topic

 

 

 

Deb / Joe,

 

 

when HTTP_REQUEST { if { [HTTP::uri] starts_with “/drainserver” } { LB::down [LB::server pool] member [substr [HTTP::query] “ip=” 3 &] [substr [HTTP::query] “port=” 5 &] } }

 

 

The LB::down command is changing the priority group to inactive which does drainstop connections off the pool member but when I give it the LB::up command the priority changes to 'active' again but the LTM is not sending HTTP connections to the server. How come?

 

 

I couldn't make the IIS server start taking connections again without logging into the LTM GUI and setting the member to 'disabled' and then to 'enabled' again. The server will then start taking connections again.

 

 

Can you tell me how to correct this?

 

 

Or, what iRule command can I use which is the same as 'enable' and 'disable' on the pool member using the GUI?

 

 

thank you!

 

 

Wade

 

 

 

 

 

 

Thanks Joe. Yes, i had something confused initially.

 

 

The iRule is working nicely now. Do you know a while loop i could use to check the session to know when they're connections are bled off the node? I've seen the logic in the iControls but I'm not sure the objects are available to iRules.

 

 

Thank you,

 

 

Wade

 

 

 

 

 

Here is some working logic others could use:

 

 

 

**the string trimming may not have been necessary

 

 

URI to control the iRule

 

 

https://172.1.1.2/drainserver?ip=172.20.1.1&port=80&poolname=WadesPool&prioritystatus=active&

 

 

iRule:

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/drainserver"} {

 

 

set strSvrIP [string trim [findstr [HTTP::query] "ip=" 3 &]]

 

set strPort [string trim [findstr [HTTP::query] "port=" 5 &]]

 

set strPoolName [findstr [HTTP::query] "poolname=" 9 &]

 

set strPoolName [string trim [findstr [HTTP::query] "poolname=" 9 &]]

 

set strPriorityStatus [string trim [findstr [HTTP::query] "prioritystatus=" 15 &]]

 

 

if { $strPriorityStatus == "active" } {

 

LB::up pool "$strPoolName" "member" "$strSvrIP" "$strPort"

 

} elseif { $strPriorityStatus == "inactive"} {

 

LB::down pool "$strPoolName" "member" "$strSvrIP" "$strPort"

 

}

 

 

log "$strPoolName $strPort $strSvrIP was set to $strPriorityStatus by the server mainteance job on servernamehere"

 

 

HTTP::respond 200 content "Web Server Reboot Programmatic MaintenanceThank you. The $strPoolName pool member $strSvrIP was successfully set to $strPriorityStatus.

"

 

}

 

}

 

 

 

 

 

 

1 Reply

  • Sorry, I accidentally answered your original post...

     

     

    If your debug logging shows LB::up is being called and you see the pool member enabled in the GUI, LTM should use it for new requests. Maybe persistence is dictating that the other pool member(s) are being used instead of the new one? Can you test with a client that doesn't have a persistence record for another pool member?

     

     

    If that isn't the issue, it might be down to a bug. In that case, you could open a case with F5 Support to diagnose the issue.

     

     

    Aaron