commit 95db10602e8f646eefed335414e40a994498cafd
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Wed Jan 18 18:17:50 2017 -0600

    Fix: tools: implement crm_failcount command-line options correctly
    
    They were a mess: the help text documented commands that weren't available,
    deprecated crm_attribute option names were supported but not current ones,
    and -l/--lifetime (which doesn't even make sense for fail counts) would print
    a warning in an infinite loop.
    
    Additionally, setting the fail count to a specific (non-zero) value, or simply
    deleting the fail count, doesn't really make sense, because it won't match the
    resource history and would likely lead to unexpected behavior. Now, attempts
    to set a (non-zero) value are ignored, and deletes are mapped to
    crm_resource --cleanup.

Index: pacemaker/tools/crm_failcount
===================================================================
--- pacemaker.orig/tools/crm_failcount
+++ pacemaker/tools/crm_failcount
@@ -1,62 +1,118 @@
 #!/bin/bash
 
-resource=""
-options=""
-target=`crm_node -n`
+USAGE_TEXT="Usage: crm_failcount <command> [<options>]
+Common options:
+ --help                 Display this text, then exit
+ --version              Display version information, then exit
+ -V, --verbose          Specify multiple times to increase debug output
+ -q, --quiet            Print only the value (if querying)
+
+Commands:
+ -G, --query            Query the current value of the resource's fail count
+ -D, --delete           Delete resource's recorded failures
+
+Additional Options:
+ -r, --resource=value   Name of the resource to use (required)
+ -N, --node=value       Set an attribute for the named node (instead of the current one)"
 
-TEMP=`getopt -o DGQVN:U:v:i:l:r: --long help,version,resource-id:,node:,uname:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \
-     -n 'crm_failcount' -- "$@"`
 
-if [ $? != 0 ] ; then echo "crm_failcount - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1 ; fi
+HELP_TEXT="crm_failcount - Query or delete resource fail counts
 
-# Note the quotes around `$TEMP': they are essential!
-eval set -- "$TEMP"
-
-function show_help() {
-	    echo "crm_failcount - A convenience wrapper for crm_attribute";
-	    echo "";
-	    echo "Set, update or remove the failcount for the specified resource on the named node";
-	    echo "";
-	    echo "Usage: crm_failcount -r resource_name command [options]";
-	    echo "Options:"
-	    echo " --help 		This text"
-	    echo " --version 		Version information"
-	    echo " -V, --verbose 		Increase debug output"
-	    echo " -q, --quiet 		Print only the value on stdout"
-	    echo ""
-	    echo " -r, --resource-id=value	The resource to update."
-	    echo ""
-	    echo "Commands:"
-	    echo " -G, --query 		Query the current value of the attribute/option"
-	    echo " -v, --update=value	Update the value of the attribute/option"
-	    echo " -D, --delete 		Delete the attribute/option"
-	    echo ""
-	    echo "Additional Options:"
-	    echo " -N, --node=value	Set an attribute for the named node (instead of the current one)."
-	    echo " -l, --lifetime=value	Until when should the setting take affect."
-	    echo "	       		Valid values: reboot, forever"
-	    echo " -i, --id=value		(Advanced) The ID used to identify the attribute"
+crm_failcount is a convenience wrapper for crm_attribute (if querying)
+and crm_resource --cleanup (if deleting).
+
+$USAGE_TEXT"
+
+
+exit_usage() {
+	if [ $# -gt 0 ]; then
+		echo "error: $@" >&2
+	fi
+	echo
+	echo "$USAGE_TEXT"
+	exit 1
 }
 
+warn() {
+	echo "warning: $@" >&2
+}
+
+command=""
+options=""
+resource=""
+target=$(crm_node -n 2>/dev/null)
+
+LONGOPTS_COMMON="help,version,verbose,quiet"
+LONGOPTS_COMMANDS="query,delete"
+LONGOPTS_OTHER="resource:,node:"
+LONGOPTS_COMPAT="delete-attr,get-value,resource-id:,uname:,lifetime:,attr-value:,attr-id:"
+
+LONGOPTS="$LONGOPTS_COMMON,$LONGOPTS_COMMANDS,$LONGOPTS_OTHER,$LONGOPTS_COMPAT"
+
+TEMP=$(getopt -o qDGQVN:U:v:i:l:r: --long $LONGOPTS -n crm_failcount -- "$@")
+if [ $? != 0 ]; then
+	exit_usage
+fi
+eval set -- "$TEMP" # Quotes around $TEMP are essential
+
 while true ; do
-    case "$1" in
-	-N|--node) target="$2"; shift; shift;;
-	-U|--uname) target="$2"; shift; shift;;
-	-v|--attr-value|-i|--attr-id) options="$options $1 $2"; shift; shift;;
-	-Q|--quiet|-D|--delete-attr|-G|--get-value|-V) options="$options $1"; shift;;
-	-r|--resource-id) options="$options -n fail-count-$2"; resource="$2"; shift; shift;;
-	--version) crm_attribute --version; exit 0;;
-	--help)
-	    show_help
-	    exit 0;;
-	--) shift ; break ;;
-	*) echo "Unknown option: $1. See --help for details." exit 1;;
-    esac
+	case "$1" in
+		--help)
+			echo "$HELP_TEXT"
+			exit 0
+			;;
+		--version)
+			crm_attribute --version
+			exit $?
+			;;
+		-Q|--quiet|-V|--verbose)
+			options="$options $1"
+			shift
+			;;
+		-G|--query|--get-value)
+			command="--query"
+			shift
+			;;
+		-D|--delete|--delete-attr)
+			command="--delete"
+			shift
+			;;
+		-r|--resource|--resource-id)
+			resource="$2"
+			shift 2
+			;;
+		-N|--node|-U|--uname)
+			target="$2"
+			shift 2
+			;;
+		-v|--attr-value)
+			if [ "$2" = "0" ]; then
+				command="--delete"
+			else
+				warn "ignoring deprecated option '$1' with nonzero value"
+			fi
+			shift 2
+			;;
+		-i|--attr-id|-l|--lifetime)
+			warn "ignoring deprecated option '$1'"
+			shift 2
+			;;
+		--)
+			shift
+			break
+			;;
+		*)
+			exit_usage "unknown option '$1'"
+			;;
+	esac
 done
 
-if [ "x$resource" = x ]; then
-    echo "You must supply a resource name to check. See 'crm_failcount --help' for details"
-    exit 1
+[ -n "$command" ]  || exit_usage "must specify a command"
+[ -n "$resource" ] || exit_usage "resource name required"
+[ -n "$target" ]   || exit_usage "node name required"
+
+if [ "$command" = "--query" ]; then
+	crm_attribute $options $command -N "$target" -n "fail-count-$resource" -t status -d 0
+else
+	crm_resource --cleanup $options -N "$target" -r "$resource"
 fi
-
-crm_attribute -N $target $options -t status -d 0
Index: pacemaker/tools/regression.sh
===================================================================
--- pacemaker.orig/tools/regression.sh
+++ pacemaker/tools/regression.sh
@@ -155,6 +155,18 @@ function test_tools() {
     cmd="cibadmin -Q -o nodes | grep node1-ram"
     test_assert 0
 
+    desc="Set a transient (fail-count) node attribute"
+    cmd="crm_attribute -n fail-count-foo -v 3 -N node1 -t status"
+    test_assert 0
+
+    desc="Query a fail count"
+    cmd="crm_failcount --query -r foo -N node1"
+    test_assert 0
+
+    desc="Delete a transient (fail-count) node attribute"
+    cmd="crm_attribute -n fail-count-foo -D -N node1 -t status"
+    test_assert 0
+
     desc="Digest calculation"
     cmd="cibadmin -Q | cibadmin -5 -p 2>&1 > /dev/null"
     test_assert 0
@@ -204,10 +216,6 @@ function test_tools() {
     cmd="crm_resource -L"
     test_assert 0
 
-    desc="Set a resource's fail-count"
-    cmd="crm_failcount -r dummy -v 10 -N node1"
-    test_assert 0
-
     desc="Require a destination when migrating a resource that is stopped"
     cmd="crm_resource -r dummy -M"
     test_assert 22
Index: pacemaker/tools/regression.tools.exp
===================================================================
--- pacemaker.orig/tools/regression.tools.exp
+++ pacemaker/tools/regression.tools.exp
@@ -419,9 +419,112 @@ Online: [ node1 ]
 </cib>
 =#=#=#= End test: Query new node attribute - OK (0) =#=#=#=
 * Passed: cibadmin       - Query new node attribute
+=#=#=#= Begin test: Set a transient (fail-count) node attribute =#=#=#=
+=#=#=#= Current cib after: Set a transient (fail-count) node attribute =#=#=#=
+<cib epoch="11" num_updates="1" admin_epoch="1">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
+      </cluster_property_set>
+      <cluster_property_set id="duplicate">
+        <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="node1" uname="node1">
+        <instance_attributes id="nodes-node1">
+          <nvpair id="nodes-node1-ram" name="ram" value="1024M"/>
+        </instance_attributes>
+      </node>
+    </nodes>
+    <resources/>
+    <constraints/>
+  </configuration>
+  <status>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1">
+          <nvpair id="status-node1-fail-count-foo" name="fail-count-foo" value="3"/>
+        </instance_attributes>
+      </transient_attributes>
+    </node_state>
+  </status>
+</cib>
+=#=#=#= End test: Set a transient (fail-count) node attribute - OK (0) =#=#=#=
+* Passed: crm_attribute  - Set a transient (fail-count) node attribute
+=#=#=#= Begin test: Query a fail count =#=#=#=
+scope=status  name=fail-count-foo value=3
+=#=#=#= Current cib after: Query a fail count =#=#=#=
+<cib epoch="11" num_updates="1" admin_epoch="1">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
+      </cluster_property_set>
+      <cluster_property_set id="duplicate">
+        <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="node1" uname="node1">
+        <instance_attributes id="nodes-node1">
+          <nvpair id="nodes-node1-ram" name="ram" value="1024M"/>
+        </instance_attributes>
+      </node>
+    </nodes>
+    <resources/>
+    <constraints/>
+  </configuration>
+  <status>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1">
+          <nvpair id="status-node1-fail-count-foo" name="fail-count-foo" value="3"/>
+        </instance_attributes>
+      </transient_attributes>
+    </node_state>
+  </status>
+</cib>
+=#=#=#= End test: Query a fail count - OK (0) =#=#=#=
+* Passed: crm_failcount  - Query a fail count
+=#=#=#= Begin test: Delete a transient (fail-count) node attribute =#=#=#=
+Deleted status attribute: id=status-node1-fail-count-foo name=fail-count-foo
+
+=#=#=#= Current cib after: Delete a transient (fail-count) node attribute =#=#=#=
+<cib epoch="11" num_updates="2" admin_epoch="1">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
+      </cluster_property_set>
+      <cluster_property_set id="duplicate">
+        <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="node1" uname="node1">
+        <instance_attributes id="nodes-node1">
+          <nvpair id="nodes-node1-ram" name="ram" value="1024M"/>
+        </instance_attributes>
+      </node>
+    </nodes>
+    <resources/>
+    <constraints/>
+  </configuration>
+  <status>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
+  </status>
+</cib>
+=#=#=#= End test: Delete a transient (fail-count) node attribute - OK (0) =#=#=#=
+* Passed: crm_attribute  - Delete a transient (fail-count) node attribute
 =#=#=#= Begin test: Digest calculation =#=#=#=
 Digest: =#=#=#= Current cib after: Digest calculation =#=#=#=
-<cib epoch="11" num_updates="0" admin_epoch="1">
+<cib epoch="11" num_updates="2" admin_epoch="1">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
@@ -442,7 +545,11 @@ Digest: =#=#=#= Current cib after: Diges
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Digest calculation - OK (0) =#=#=#=
@@ -450,7 +557,7 @@ Digest: =#=#=#= Current cib after: Diges
 =#=#=#= Begin test: Replace operation should fail =#=#=#=
 Call failed: Update was older than existing configuration
 =#=#=#= Current cib after: Replace operation should fail =#=#=#=
-<cib epoch="11" num_updates="0" admin_epoch="1">
+<cib epoch="11" num_updates="2" admin_epoch="1">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
@@ -471,7 +578,11 @@ Call failed: Update was older than exist
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Replace operation should fail - Update was older than existing configuration (205) =#=#=#=
@@ -480,7 +591,7 @@ Call failed: Update was older than exist
 Error performing operation: No such device or address
 scope=status  name=standby value=off
 =#=#=#= Current cib after: Default standby value =#=#=#=
-<cib epoch="11" num_updates="0" admin_epoch="1">
+<cib epoch="11" num_updates="2" admin_epoch="1">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
@@ -501,7 +612,11 @@ scope=status  name=standby value=off
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Default standby value - OK (0) =#=#=#=
@@ -530,7 +645,11 @@ scope=status  name=standby value=off
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Set standby status - OK (0) =#=#=#=
@@ -560,7 +679,11 @@ scope=nodes  name=standby value=true
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Query standby value - OK (0) =#=#=#=
@@ -590,7 +713,11 @@ Deleted nodes attribute: id=nodes-node1-
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Delete standby value - OK (0) =#=#=#=
@@ -620,7 +747,11 @@ Deleted nodes attribute: id=nodes-node1-
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Create a resource - OK (0) =#=#=#=
@@ -656,7 +787,11 @@ Set 'dummy' option: id=dummy-meta_attrib
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Create a resource meta attribute - OK (0) =#=#=#=
@@ -691,7 +826,11 @@ false
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Query a resource meta attribute - OK (0) =#=#=#=
@@ -724,7 +863,11 @@ Deleted 'dummy' option: id=dummy-meta_at
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Remove a resource meta attribute - OK (0) =#=#=#=
@@ -761,7 +904,11 @@ Set 'dummy' option: id=dummy-instance_at
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
+    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <transient_attributes id="node1">
+        <instance_attributes id="status-node1"/>
+      </transient_attributes>
+    </node_state>
   </status>
 </cib>
 =#=#=#= End test: Create a resource attribute - OK (0) =#=#=#=
@@ -797,58 +944,21 @@ Set 'dummy' option: id=dummy-instance_at
     <constraints/>
   </configuration>
   <status>
-    <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate"/>
-  </status>
-</cib>
-=#=#=#= End test: List the configured resources - OK (0) =#=#=#=
-* Passed: crm_resource   - List the configured resources
-=#=#=#= Begin test: Set a resource's fail-count =#=#=#=
-=#=#=#= Current cib after: Set a resource's fail-count =#=#=#=
-<cib epoch="17" num_updates="1" admin_epoch="1">
-  <configuration>
-    <crm_config>
-      <cluster_property_set id="cib-bootstrap-options">
-        <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
-      </cluster_property_set>
-      <cluster_property_set id="duplicate">
-        <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
-      </cluster_property_set>
-    </crm_config>
-    <nodes>
-      <node id="node1" uname="node1">
-        <instance_attributes id="nodes-node1">
-          <nvpair id="nodes-node1-ram" name="ram" value="1024M"/>
-        </instance_attributes>
-      </node>
-    </nodes>
-    <resources>
-      <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
-        <meta_attributes id="dummy-meta_attributes"/>
-        <instance_attributes id="dummy-instance_attributes">
-          <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
-        </instance_attributes>
-      </primitive>
-    </resources>
-    <constraints/>
-  </configuration>
-  <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
     </node_state>
   </status>
 </cib>
-=#=#=#= End test: Set a resource's fail-count - OK (0) =#=#=#=
-* Passed: crm_failcount  - Set a resource's fail-count
+=#=#=#= End test: List the configured resources - OK (0) =#=#=#=
+* Passed: crm_resource   - List the configured resources
 =#=#=#= Begin test: Require a destination when migrating a resource that is stopped =#=#=#=
 Resource 'dummy' not moved: active in 0 locations.
 You can prevent 'dummy' from running on a specific location with: --ban --host <name>
 Error performing operation: Invalid argument
 =#=#=#= Current cib after: Require a destination when migrating a resource that is stopped =#=#=#=
-<cib epoch="17" num_updates="1" admin_epoch="1">
+<cib epoch="17" num_updates="0" admin_epoch="1">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
@@ -878,9 +988,7 @@ Error performing operation: Invalid argu
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
     </node_state>
   </status>
@@ -891,7 +999,7 @@ Error performing operation: Invalid argu
 Error performing operation: node 'i.dont.exist' is unknown
 Error performing operation: No such device or address
 =#=#=#= Current cib after: Don't support migration to non-existant locations =#=#=#=
-<cib epoch="17" num_updates="1" admin_epoch="1">
+<cib epoch="17" num_updates="0" admin_epoch="1">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
@@ -921,9 +1029,7 @@ Error performing operation: No such devi
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
     </node_state>
   </status>
@@ -963,9 +1069,7 @@ Error performing operation: No such devi
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
     </node_state>
   </status>
@@ -1028,9 +1132,7 @@ Online: [ node1 ]
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1082,9 +1184,7 @@ Error performing operation: Invalid argu
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1140,9 +1240,7 @@ WARNING: Creating rsc_location constrain
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1192,9 +1290,7 @@ WARNING: Creating rsc_location constrain
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1245,9 +1341,7 @@ false
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1297,9 +1391,7 @@ false
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1353,9 +1445,7 @@ false
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1408,9 +1498,7 @@ false
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1463,9 +1551,7 @@ false
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1519,9 +1605,7 @@ true
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1574,9 +1658,7 @@ true
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1629,9 +1711,7 @@ true
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1686,9 +1766,7 @@ Error performing operation: No such devi
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1772,9 +1850,7 @@ Online: [ node1 node2 node3 ]
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1859,9 +1935,7 @@ WARNING: Creating rsc_location constrain
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -1947,9 +2021,7 @@ WARNING: Creating rsc_location constrain
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -2052,9 +2124,7 @@ Online: [ node1 node2 node3 ]
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -2136,9 +2206,7 @@ Online: [ node1 node2 node3 ]
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
@@ -2219,9 +2287,7 @@ Online: [ node1 node2 node3 ]
   <status>
     <node_state id="node1" uname="node1" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
       <transient_attributes id="node1">
-        <instance_attributes id="status-node1">
-          <nvpair id="status-node1-fail-count-dummy" name="fail-count-dummy" value="10"/>
-        </instance_attributes>
+        <instance_attributes id="status-node1"/>
       </transient_attributes>
       <lrm id="node1">
         <lrm_resources>
