Service Instance Health Check
In Contrail Release 3.00 and greater, a service instance health check is used to determine the liveliness of a service provided by a VM.
Health Check Overview
The service instance health check is used to determine the liveliness of a service provided by a VM. checking whether the service is operationally up or down. The vRouter agent uses ping and an HTTP URL to the link local address to check the liveliness of the interface.
If the health check determines that a service is no longer operational, it removes the routes for the VM, thereby disabling forwarding packets to the VM.
Health Check Object Configuration Model
The following are the properties of the Health Check object.
- enabled - monitor-type # Health Check protocol type to be used (HTTP/PING) - delay # delay between to health check attempts - timeout # timeout for single health check attempt - max-retries # number of retries to attempt before declaring a failure - http-method # HTTP method to be used valid only for monitor-type (HTTP) (currently not supported) - url-path # url string for HTTP, destination IP for all other cases - expected-codes # expected exit codes (currently not supported)
Using the Health Check
A REST API can be used to create a Health Check object and define its associated properties, then a link is added to the VM interface.
The Heath Check object can be linked to multiple VM interfaces. Additionally, a VM interface can be associated with multiple Health Check objects. The following is an example.
HealthCheckObject 1 ---------------- VirtualMachineInterface 1 ---------------- HealthCheckObject 2
|
|
VirtualMachineInterface 2
Health Check Process
The Contrail vRouter agent is responsible for providing the health check service. The agent spawns a Python script to monitor the status of a service hosted on a VM on the same compute node, and the script updates the status to the vRouter agent.
The vRouter agent acts on the status provided by the script to withdraw or restore the exported interface routes. It is also responsible for providing a link-local metadata IP for allowing the script to communicate with the destination IP from the underlay network, using appropriate NAT translations. In a running system this information is displayed in the vRouter agent introspect at:
http://<compute-node-ip>:8085/Snh_HealthCheckSandeshReq?uuid=
![]() | Note: Running Health Check creates flow entries to perform translation from underlay to overlay, consequently, in a heavily loaded environment with a full flow table, it is possible to observe false failures. |


