Avi Load Balancer provides a way to deactivate back-end servers for maintenance actively. When a server is deactivated for maintenance, it marks the server Disabled. Existing sessions are terminated immediately or allowed to end gracefully, either with a user-settable maximum timeout or with no timeout.

The Graceful Deactivate Timeout parameter set for a pool governs how servers within the pool are deactivated as follows:

  • Deactivate with immediate effect: All client sessions are immediately terminated. The pool’s Graceful Deactivate Timeout parameter must be set to 0.

  • Gracefully deactivate with a finite timeout: No new sessions are sent to the server. Existing sessions are allowed to terminate on their own, up to the specified timeout. Once the timeout is reached, any remaining sessions are immediately terminated. The pool’s Graceful Deactivate Timeout parameter must range from 1-7200 minutes.

  • Gracefully deactivate with infinite timeout: No new sessions are sent to the server. All existing sessions are allowed to terminate on their own. The pool’s Graceful Deactivate Timeout parameter must be set to -1.

When servers are gracefully deactivated until all flows drain, the idle connections, if any, will be deleted immediately.

In-flight connections are closed at the end of a request for a request-switched virtual service and the end of a client connection for a connection-switched virtual service.

When servers are gracefully deactivated with a timeout value, the idle connections are closed immediately, while any busy or bound connection will be closed at the end of the timeout. Any existing request will be processed until the end of the timeout. Any new requests, whether from an existing connection or a new connection, will be sent to a new server.

Setting a Pool’s Graceful Disable Timeout Parameter

  1. Navigate to Applications > Pools to display a list of pools.

  2. Identify the pool containing the servers whose timeout parameter is to be set, and click the pencil icon at the right end of that pool.

  3. In the Edit Pool window, set the Graceful Deactivate Timeout field to 0, -1, or within the range of 1-7200 minutes.

Deactivating a Server for Maintenance

  1. Navigate to Applications > Pools.

  2. Click the pool name.

  3. Click Servers tab.

  4. Select the option next to the name of each server to be deactivated.

  5. Click the GRACEFUL DISABLE button.

Note:

Avi Load Balancer can be configured to use information in the health-check responses from servers to detect when a server is in maintenance mode. For information, see Detecting Server Maintenance Mode with a Health Monitor.

You can configure how the pool server must behave when it is deactivated through the CLI as follows:

Use disallow_new_connection to specify that a node or pool member allows existing connections to time out but to not allow new connections, as shown below:

configure pool <pool name> server_disable_type disallow_new_connection

save

Use allow_new_connection_if_persistence_present to disallow the allocation of new connections with persistence deactivated, as shown below:

configure pool <pool name> server_disable_type  allow_new_connection_if_persistence_present

save

When allow_new_connection_if_persistence_present is configured, the timer is refreshed if a disabled server is picked from the persist table.

When deactivated, the node or pool member continues to process persistent and active connections.

New connections can be accepted only if the connections belong to an existing persistent connection.

These persistence matches for new connections continue until persistence times out.