manually stopping and starting heartbeat2 resources from commandline (HEARTBEAT)
This document (7002020) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 10 Service Pack 1
Situation
Resolution
crm_resource -r resource_t1 --meta -p target_role -v started
to change a resource in heartbeat2 from the commandline from started to stopped issue
crm_resource -r resource_t1 --meta -p target_role -v stopped
these commands can be issued from any node of the cluster and one should be root to do this.
Example: there be a 3 node cluster with the following entry in cib.xml
<primitive id="resource_t1" class="lsb" type="nfsserver" provider="heartbeat">
<meta_attributes id="resource_t1_meta_attrs">
<attributes>
<nvpair id="resource_t1_metaattr_target_role" name="target_role" value="stopped"/>
</attributes>
</meta_attributes>
</primitive>
this means that a resource nfsserver with the name "resource_t1" has the target role stopped. The cluster will stop the resource.
To start this from the commandline the command is:
crm_resource -r resource_t1 --meta -p target_role -v started
and will result in
<primitive id="resource_t1" class="lsb" type="nfsserver" provider="heartbeat">
<meta_attributes id="resource_t1_meta_attrs">
<attributes>
<nvpair id="resource_t1_metaattr_target_role" name="target_role" value="started"/>
</attributes>
</meta_attributes>
</primitive>
this is consistant with modifications done via the GUI so the syntax
crm_resource -r RESOURCE_NAME --meta -p target_role -v (started or stopped)
will start and stop a heartbeat2 resource from the commandline as if done via the GUI.
Additional Information
Reminder 2: to omit the --meta in the crm_resource command will produce a second entry in the cib.xml so the result of a
crm_resource -r resource_t1 -p target_role -v started
could be entries like
<primitive id="resource_t1" class="lsb" type="nfsserver" provider="heartbeat">
<meta_attributes id="resource_t1_meta_attrs">
<attributes>
<nvpair id="resource_t1_metaattr_target_role" name="target_role" value="started"/>
</attributes>
</meta_attributes>
<instance_attributes id="resource_t1">
<attributes>
<nvpair id="resource_t1-target_role" name="target_role" value="started"/>
</attributes>
</instance_attributes>
</primitive>
which can lead to unpredictable behaviour of the cluster to start and stop commands.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7002020
- Creation Date: 26-Nov-2008
- Modified Date:25-Mar-2021
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com