Forum Discussion
Paul_Gaynor_706
Nimbostratus
Jan 16, 2009IRule causes Virtual Servers to be "up"?
Hi Everyone,
When I replace the first iRule below with the second iRule belown on a virtual server the VS is marked up when the server pool has no available members? Any idea what might be going on here?
First iRule
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if {$uri starts_with "/services"}
{}
else
{
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
Replacement iRule
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/services" } {
pool ws_server_pool
}
elseif { [string tolower [HTTP::uri]] equals "/public/diagnostic.do"}
{
pool gs_server_pool
}
else {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
Thanks!
Paul
- wolfpack_98881
Nimbostratus
I believe that the virtual will inherit any monitoring state of a pool referenced in an iRule. Your previous rule didn't contain a pool - thus it had no monitoring associated with it. Your new rule references 2 pools. It would only take 1 pool member among both pools to make the virtual "up". You can test this by marking all pools down and looking at the corresponding virtual status. I seem to also remember that if there are no monitors on the pools referenced within the irule - then the virtual where that irule applied with always be up. I'd personally love some confirmation on that, but that is at least the behavior that I've observed. - Nicolas_Menant
Employee
i confirm what wolfpack said. Status of pool within the iRule will impact the VS status. - Paul_Gaynor_706
Nimbostratus
Yeah, i verified that taking down the nodes in the pools that are referenced in the iRule does change the status of the VS. - dennypayne
Employee
I have found a "trick" to get around this behavior. If you set the pool name as a variable and then call the variable in the pool statement, the iRule doesn't seem to "know" about status anymore. I had a similar problem with this rule:when HTTP_REQUEST { If the QA cookie exists, go to the QA pool. if { [HTTP::cookie exists "QAPilot"] } { pool WWW-QA } else { pool WWW-GLOB } } when LB_FAILED { LB::reselect pool WWW-GLOB }
when HTTP_REQUEST { If the QA cookie exists, go to the QA pool. if { [HTTP::cookie exists "QAPilot"] } { set lb_pool "WWW-QA" } else { set lb_pool "WWW-GLOB" } pool $lb_pool } If load balancing fails to the QA pool, load balance to the PROD pool. when LB_FAILED { LB::reselect pool WWW-GLOB }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects