Customize Application Rules
Application Rules — A way to manage traffic based on specific requests. You can create advanced load balancing rules that cannot be configured through Application Profiles or through other services on the Edge router.
Create rule
-
From Control Panel, open the Cloud Director panel: Cloud powered by VMware → Cloud Director.
-
Open the virtual data center page.
-
Go to Networking → Edges.
-
Open the page of the desired Edge.
-
Press SERVICES.
-
Open the Load Balancer → Application Rules tab.
-
Press +.
-
Enter the name of the rule.
-
Insert a script that will determine the balancing:
- В другой пул
- На внешний ресурс
If the primary pool fails, traffic can be redirected to another balancing pool. For the rule to work, multiple pools must be configured on the balancer. All members of the main pool must be in the
down
state. Script view:acl pool_down nbsrv(<primary_pool_name>) eq 0
use_backend <secondary_pool_name> if <primary_pool_name>Specify:
<primary_pool_name>
is the name of the main pool;<secondary_pool_name>
— the name of the pool to which the traffic will be redirected.
If all members of the main pool are in the
down
state, traffic can be redirected to an external website using a script:acl pool_down nbsrv(<pool_name>) eq 0
redirect location <url> if pool_downSpecify:
<pool_name>
is the name of the main pool;<url>
— Website URL.
-
Press KEEP.
Add a rule to the virtual server
- From Control Panel, open the Cloud Director panel: Cloud powered by VMware → Cloud Director.
- Open the virtual data center page.
- Go to Networking → Edges.
- Open the page of the desired Edge.
- Press SERVICES.
- Open the Load Balancer → Virtual Servers tab.
- Highlight virtual server.
- Click .
- Open the Advanced tab.
- Press +.
- Add rule.