Cluster module manages Red Hat Cluster Suite.
Module name: “cluster”
Module version: 1.0
See Modules - Common API for general module description.
Functions:
APIs
Get supported API versions. See Modules - Common API for description.
get_cluster.conf
Retrieves cluster.conf.
No input variables.
Output variables:
- “cluster.conf” (XML) – current
cluster.conf
On failure:
- No special errors defined, only
generic ones might get returned.
set_cluster.conf
Saves cluster.conf to proper location. If “propagate” is
“true”, cluster.conf will be propagated to the cluster.
No
verification of cluster.conf is performed; propagation of invalid
cluster.conf might bring cluster to halt!!!
Input variables:
- “cluster.conf” (XML) –
required
- “propagate” (boolean) – optional, defaults to
“false”
No output variables.
On failure:
- No special errors defined, only
generic ones might get returned.
status
Retrieve cluster status. If node is not configured to be a part of cluster, empty <cluster/> tag will be returned.
No input variables.
Output variables:
- “status” (XML) – status of cluster,
nodes and services.
eg:
<cluster minQuorum="1"
name="113716905453" alias=”My Cluster” quorate="true"
votes="2">
<node clustered="true"
name="blue" online="true" uptime="336225"
votes="1"/> - clustered – part of cluster?; online –
PC is up
<node clustered="true" name="green"
online="true" uptime="331625"
votes="1"/>
<service autostart="true"
failed="false" name="dsa" nodename="green"
running="true" time_since_transition="12345"/>
<service
autostart="true" failed="false" name="new_serv"
nodename="green" running="true"
time_since_transition="54321"/>
</cluster>
On failure:
- No special errors defined, only
generic ones might get returned.
start_service
Start service “servicename”. If “nodename” is specified,
service is started on that node, otherwise it will be started on a
node chosen by service manager.
If service was not running, it
is started. If it was running, it is relocated to “nodename”.
Input variables:
- “servicename” (string) – name of
service to manipulate
- “nodename” (string) – optional
name of node for service to start on / relocate to
No output variables.
On failure:
- 1 – service manager is not running on this
managed system
- generic ones
migrate_service
Migrate the virtual service “servicename” to cluster node “nodename.” To migrate the virtual service, it must be started, and xend must be running and configured to allow live migration on both its current node and on “nodename.” If the service is not started, it will be started on “nodename.”
Input variables:
- “servicename” (string) – name of
the virtual service to migrate.
- “nodename” (string) –
name of node to which the virtual service is to be migrated.
No output variables.
On failure:
- 1 – service manager is not running on this
managed system
- generic ones
stop_service
Stop service “servicename”. It is not an error to stop already stopped service.
Input variables:
- “servicename” (string) – name of
service to stop
No output variables.
On failure:
- 1 – service manager is not running on this
managed system
- generic ones
restart_service
Restart service “servicename” on node it is currently running. If service is not running, it will be started on a node chosen by service manager.
Input variables:
- “servicename” (string) – name of
service to manipulate
No output variables.
On failure:
- 1 – service manager is not running on this
managed system
- generic ones
start_node
Start cluster infrastructure on this node (also, enable daemons'
boot startup).
It is not an error to start already started
node.
Input variables:
- “cluster_startup” (boolean) –
optional, default “false”, cluster is starting up (wait for all
to come up, then start services – avoid fencing on startup)
No output variables.
On failure:
- No special errors defined, only generic ones
might get returned.
stop_node
Stop cluster infrastructure on this node (also, disable daemons'
boot startup).
It is not an error to stop already stopped node.
Input variables:
- “cluster_shutdown” (boolean) –
optional, default “false”, cluster is shutting down (don't
bounce services around)
- “purge_conf” (boolean) –
optional, default “false”, delete cluster.conf; start_node() cannot be called any more, without calling set_cluster.conf() first
No output variables.
On failure:
- No special errors defined, only generic ones
might get returned.
fence_node
Fence node “nodename”.
Input variables:
- nodename (string) – name of node to
fence
No output variables.
On failure:
- No special errors defined, only generic ones
might get returned.