Disable a load balancing service in a Citrix ADC VPX Appliance
Network outages such as system upgrades or hardware maintenance of servers are scheduled at regular intervals. During this time, you must disable the Citrix ADC load balancing services representing these servers,
You can perform a hard shutdown or graceful shutdown of a service. Hard shutdown disables a service immediately disrupting any established sessions and any transactions in progress, which may result in data loss. Hard shutdown changes the state of the service to DOWN.
Graceful shutdown disables a service after a wait time or after all the current active client connections are closed by either the server or the client. Graceful shutdown first changes the state of the service to Transition Out of Service (TROFS) state till the wait time is over or all the active connections are closed, after which the state changes to DOWN.
Often, however, you cannot estimate the amount of time needed for all the connections to a service to complete the existing transactions. If a transaction is unfinished when the wait time expires, shutting down the service may result in data loss. In this case, you can specify the graceful option, so that the service is disabled only when all the current active client connections are closed by either the server or the client. See the following table for behavior if you specify a wait time in addition to graceful option.
Persistence is maintained according to the specified method even if you enable graceful shutdown. The system continues to serve all the persistent clients, including new connections from the clients, unless the service is marked DOWN during the graceful shutdown state as a result of the checks made by a monitor.
The following table describes the functionality of graceful shutdown of a service for different combinations of graceful and wait time values.
Graceful |
Wait time |
Description |
---|---|---|
Enabled | Specified | Service is shut down after the last of the current active client connections is served, even if the wait time has not expired. The appliance checks the status of the connections once every second. If the wait time expires, any open sessions are closed. |
Disabled | Specified | Service is shut down only after the wait time expires, even if all established connections are served before expiration. |
Enabled | Not specified | Service is shut down only after the last of the previously established connections is served, regardless of the time taken to serve the last connection. |
Disabled | Not specified | No graceful shutdown. Service is shut down immediately after the disable option is chosen or the disable command is issued. (The default wait time is zero seconds.) |
Before you begin
Before you disable a load balancing service in a Citrix ADC VPX Appliance, make sure that:
- You have deployed a Citrix ADC VPX appliance and the appliance is UP and running in your setup. For more information, see Deploy a Citrix ADC VPX instance.
-
You have a basic understanding of the load balancing feature of a Citrix ADC appliance. For more information, see:
- Load Balancing
- You have an understanding of the following concepts related to a load balancing service:
- various states of a load balancing service. For more information, Load balance service states.
- Graceful shutdown of a load balancing service. For more information, Graceful shutdown of services.
- You have a basic understanding of the Citrix ADC NITRO REST APIs. For more information, see Citrix ADC NITRO API reference.
Steps to disable a load balancing service in a Citrix ADC VPX Appliance
To disable a load balance service in a Citrix ADC appliance, you use the service NITRO API object with action as disable. Optionally, for graceful shutdown of the service, set one or both of the following properties in the request payload:
Name |
Description |
---|---|
graceful | Shut down gracefully, not accepting any new connections, and disabling the service when all of its connections are closed. Default value: NO Possible values: YES, NO |
delay | Wait time, in seconds, allocated to the Citrix ADC for a graceful shutdown of the service. During this period, new requests are sent to the service only for clients who already have persistent sessions on the appliance. Requests from new clients are load balanced among other available services. After the delay time expires, no requests are sent to the service, and the service is marked as unavailable (OUT OF SERVICE). Default value: 0 |
For more information about the service object and its properties, see Citrix NITRO API reference for service.
Request components
Request field | Value |
---|---|
HTTP Method | POST |
URL | http://<Citrix-ADC-IP-address(NSIP)>/nitro/v1/config/service?action=disable |
Request Headers | Content-Type: application/json |
Request Payload |
{"service":{"name":<value>,"delay":<value>,"graceful":<value>}} Example: {"service":{"name": "SVC-1”,"graceful": “Yes”}}
|
Curl request
Use the following curl command syntax to disable a service in a Citrix ADC appliance:
curl -X POST -H "Content-Type: application/json" -u <username>:<password> http://<Citrix-ADC-IP-address(NSIP)>/nitro/v1/config/service?action=disable -d '{"service": {"name": "<value>","graceful": "<value>", "delay": "<value>"}}’
Examples
Example description | Curl request |
---|---|
Perform a graceful shutdown of a service named SVC-1 in a Citrix ADC appliance, which has the NSIP address of 192.0.0.33. | curl -X POST -H "Content-Type: application/json" -u nsroot:examplepassword http:// 192.0.0.33/nitro/v1/config/service?action=disable -d '{"service": {"name": "SVC-1”, "graceful": “Yes”}}' |
Perform a hard shutdown of a service named SVC-1 in a Citrix ADC appliance, which has the NSIP address of 192.0.0.33. | curl -X POST -H "Content-Type: application/json" -u nsroot:examplepassword http:// 192.0.0.33/nitro/v1/config/service?action=disable -d '{"service": {"name": "SVC-1}}' |