The purpose of the healer plugin is to enable agentless autohealing capability to Cloudify deployments. The functionality is intended to be conceptually similar to 'liveness probes' found elsewhere. The healer runs a process on the manager, and will only function for target hosts that have routable IPs from the manager.
The plugin defines a new node type and relationship type. The node type holds the configuration of the healer, and the relationship actually runs it.
The Healer
type configures the healer based on 4 different modes. The modes are selected by setting the type
property to one of:
- ping - Performs ICMP pings on a host
- http - Performs an HTTP get on a URL
- port - Performs an connection open on a TCP port
- custom - TBD
- cfy_creds - Cloudify manager login credentials of the form
username,password,tenant_name
. This is needed by the healer to run the heal workflow on the target node. These are best stored using the secret store. - debug - The plugin starts a background process that logs to '/tmp/healer_<deployment_id>_pid.log'. This logging occurs at
info
level unless thedebug
property is true. - config/count The number of failed attempts that will trigger a heal.
- config/frequency The pause between retries in seconds
The ping healer performs an ICMP ping on the target host. Take care that the target host permits inbound ICMP traffic from the manager. It only requires the common properties to operate.
The HTTP healer performs an HTTP GET on the target host. If a non-2xx response status code is received, it is regarded as a failure. Lower level connection problems also will count as failures. Besides the common properties, the HTTP healer needs:
- port - The target port (int)
- path - The URL path (string)
- secure - Whether HTTPS will be used (boolean)
The port healer tries to open a connection to the supplied port on the target host. If it can't, it is considered a failure. Besides the common properties, the port healer needs:
- port - The target port (int)
This relationship source should be the cloudify.nodes.Healer node template, and the target should be a compute node. The ip address of the compute node is used to supply the target IP address to the various healers. It has no inputs.
There are three example blueprints, one that demonstrates pinging a host with debug on, one that demonstrates performing an HTTPGET on an Apache web server, and one that attempts to connect to a socket. To see healing work, simply kill the target server and wait. You can tail the /tmp/heal_<deployment_id>_<pid>
file to see the failure detection. Note that once a heal happens, a new log file is opened with the new healer pid. If you turn debug on, the actual individual test repetitions are logged.