diff --git a/pengine/master.c b/pengine/master.c
index b66a4459ed..29a64b89f6 100644
--- a/pengine/master.c
+++ b/pengine/master.c
@@ -1,845 +1,846 @@
 /* 
  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  * 
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include <crm_internal.h>
 
 #include <crm/msg_xml.h>
 #include <allocate.h>
 #include <lib/pengine/utils.h>
 #include <utils.h>
 
 #define VARIANT_CLONE 1
 #include <lib/pengine/variant.h>
 
 extern gint sort_clone_instance(gconstpointer a, gconstpointer b);
 
 extern int master_score(resource_t *rsc, node_t *node, int not_set_value);
 
 static void
 child_promoting_constraints(
 	clone_variant_data_t *clone_data, enum pe_ordering type,
 	resource_t *rsc, resource_t *child, resource_t *last, pe_working_set_t *data_set)
 {
 	if(child == NULL) {
 		if(clone_data->ordered && last != NULL) {
 			crm_debug_4("Ordered version (last node)");
 			/* last child promote before promoted started */
 			new_rsc_order(last, RSC_PROMOTE, rsc, RSC_PROMOTED, type, data_set);
 		}
 		return;
 	}
 
 	/* child promote before global promoted */
 	new_rsc_order(child, RSC_PROMOTE, rsc, RSC_PROMOTED, type, data_set);
 	
 	/* global promote before child promote */
 	new_rsc_order(rsc, RSC_PROMOTE, child, RSC_PROMOTE, type, data_set);
 
 	if(clone_data->ordered) {
 		crm_debug_4("Ordered version");
 		if(last == NULL) {
 			/* global promote before first child promote */
 			last = rsc;
 
 		} /* else: child/child relative promote */
 
 		order_start_start(last, child, type);
 		new_rsc_order(last, RSC_PROMOTE, child, RSC_PROMOTE, type, data_set);
 
 	} else {
 		crm_debug_4("Un-ordered version");
 	}
 }
 
 static void
 child_demoting_constraints(
 	clone_variant_data_t *clone_data, enum pe_ordering type,
 	resource_t *rsc, resource_t *child, resource_t *last, pe_working_set_t *data_set)
 {
 	if(child == NULL) {
 		if(clone_data->ordered && last != NULL) {
 			crm_debug_4("Ordered version (last node)");
 			/* global demote before first child demote */
 			new_rsc_order(rsc, RSC_DEMOTE, last, RSC_DEMOTE,
 				      pe_order_implies_left, data_set);
 		}
 		return;
 	}
 	
 	/* child demote before global demoted */
 	new_rsc_order(child, RSC_DEMOTE, rsc, RSC_DEMOTED,
 		      pe_order_implies_right_printed, data_set);
 	
 	/* global demote before child demote */
 	new_rsc_order(rsc, RSC_DEMOTE, child, RSC_DEMOTE, 
 		      pe_order_implies_left_printed, data_set);
 	
 	if(clone_data->ordered && last != NULL) {
 		crm_debug_4("Ordered version");
 
 		/* child/child relative demote */
 		new_rsc_order(child, RSC_DEMOTE, last, RSC_DEMOTE, type, data_set);
 
 	} else if(clone_data->ordered) {
 		crm_debug_4("Ordered version (1st node)");
 		/* first child stop before global stopped */
 		new_rsc_order(child, RSC_DEMOTE, rsc, RSC_DEMOTED, type, data_set);
 
 	} else {
 		crm_debug_4("Un-ordered version");
 	}
 }
 
 static void
 master_update_pseudo_status(
 	resource_t *rsc, gboolean *demoting, gboolean *promoting) 
 {	
 	if(rsc->children) {
 	    slist_iter(child, resource_t, rsc->children, lpc,
 		       master_update_pseudo_status(child, demoting, promoting)
 		);
 	    return;
 	}
     
 	CRM_ASSERT(demoting != NULL);
 	CRM_ASSERT(promoting != NULL);
 
 	slist_iter(
 		action, action_t, rsc->actions, lpc,
 
 		if(*promoting && *demoting) {
 			return;
 
 		} else if(action->optional) {
 			continue;
 
 		} else if(safe_str_eq(RSC_DEMOTE, action->task)) {
 			*demoting = TRUE;
 
 		} else if(safe_str_eq(RSC_PROMOTE, action->task)) {
 			*promoting = TRUE;
 		}
 		);
 
 }
 
 #define apply_master_location(list)					\
 	slist_iter(							\
 		cons, rsc_to_node_t, list, lpc2,			\
 		cons_node = NULL;					\
 		if(cons->role_filter == RSC_ROLE_MASTER) {		\
 			crm_debug_2("Applying %s to %s",			\
 				  cons->id, child_rsc->id);		\
 			cons_node = pe_find_node_id(			\
 				cons->node_list_rh, chosen->details->id); \
 		}							\
 		if(cons_node != NULL) {					\
 			int new_priority = merge_weights(		\
 				child_rsc->priority, cons_node->weight); \
 			crm_debug_2("\t%s: %d->%d (%d)", child_rsc->id,	\
 				child_rsc->priority, new_priority, cons_node->weight);	\
 			child_rsc->priority = new_priority;		\
 		}							\
 		);
 
 static node_t *
 can_be_master(resource_t *rsc)
 {
 	node_t *node = NULL;
 	node_t *local_node = NULL;
 	resource_t *parent = uber_parent(rsc);
 	clone_variant_data_t *clone_data = NULL;
 	int level = LOG_DEBUG_2;
 #if 0
 	enum rsc_role_e role = RSC_ROLE_UNKNOWN;
 	role = rsc->fns->state(rsc, FALSE);
 	crm_info("%s role: %s", rsc->id, role2text(role));
 #endif
 	
 	if(rsc->children) {
 	    slist_iter(
 		child, resource_t, rsc->children, lpc,
 		if(can_be_master(child) == NULL) {
 		    do_crm_log_unlikely(level, "Child %s of %s can't be promoted", child->id, rsc->id);
 		    return NULL;
 		}
 		);
 	}
 
 	node = rsc->fns->location(rsc, NULL, FALSE);
 	if(node == NULL) {
 		do_crm_log_unlikely(level, "%s cannot be master: not allocated", rsc->id);
 		return NULL;
 	
 	} else if(is_not_set(rsc->flags, pe_rsc_managed)) {
 	    if(rsc->fns->state(rsc, TRUE) == RSC_ROLE_MASTER) {
 		crm_notice("Forcing unmanaged master %s to remain promoted on %s",
 			   rsc->id, node->details->uname);
 
 	    } else {
 		return NULL;
 	    }
 
 	} else if(rsc->priority < 0) {
 		do_crm_log_unlikely(level, "%s cannot be master: preference: %d",
 			   rsc->id, rsc->priority);
 		return NULL;
 
 	} else if(can_run_resources(node) == FALSE) {
 		do_crm_log_unlikely(level, "Node cant run any resources: %s",
 			    node->details->uname);
 		return NULL;
 	}
 	
 	get_clone_variant_data(clone_data, parent);
 	local_node = pe_find_node_id(
 		parent->allowed_nodes, node->details->id);
 
 	if(local_node == NULL) {
 		crm_err("%s cannot run on %s: node not allowed",
 			rsc->id, node->details->uname);
 		return NULL;
 
 	} else if(local_node->count < clone_data->master_node_max
 		  || is_not_set(rsc->flags, pe_rsc_managed)) {
 		return local_node;
 
 	} else {
 		do_crm_log_unlikely(level, "%s cannot be master on %s: node full",
 			    rsc->id, node->details->uname);
 	}
 
 	return NULL;
 }
 
 static gint sort_master_instance(gconstpointer a, gconstpointer b)
 {
 	int rc;
 	enum rsc_role_e role1 = RSC_ROLE_UNKNOWN;
 	enum rsc_role_e role2 = RSC_ROLE_UNKNOWN;
 
 	const resource_t *resource1 = (const resource_t*)a;
 	const resource_t *resource2 = (const resource_t*)b;
 
 	CRM_ASSERT(resource1 != NULL);
 	CRM_ASSERT(resource2 != NULL);
 
 	role1 = resource1->fns->state(resource1, TRUE);
 	role2 = resource2->fns->state(resource2, TRUE);
 	
 	rc = sort_rsc_index(a, b);
 	if( rc != 0 ) {
 		return rc;
 	}
 	
 	if(role1 > role2) {
 		return -1;
 
 	} else if(role1 < role2) {
 		return 1;
 	}
 	
 	return sort_clone_instance(a, b);
 }
 
 static void master_promotion_order(resource_t *rsc) 
 {
     node_t *node = NULL;
     node_t *chosen = NULL;
     clone_variant_data_t *clone_data = NULL;
     get_clone_variant_data(clone_data, rsc);
 
     if(clone_data->merged_master_weights) {
 	return;
     }
     clone_data->merged_master_weights = TRUE;
     crm_debug_2("Merging weights for %s", rsc->id);
     slist_iter(
 	child, resource_t, rsc->children, lpc,
 	crm_debug_2("%s: %d", child->id, child->sort_index);
 	);
     dump_node_scores(LOG_DEBUG_3, rsc, "Before", rsc->allowed_nodes);
 
     slist_iter(
 	child, resource_t, rsc->children, lpc,
 
 	chosen = child->fns->location(child, NULL, FALSE);
 	if(chosen == NULL || child->sort_index < 0) {
 	    crm_debug_3("Skipping %s", child->id);
 	    continue;
 	}
 
 	node = (node_t*)pe_find_node_id(
 	    rsc->allowed_nodes, chosen->details->id);
 	CRM_ASSERT(node != NULL);
 	/* adds in master preferences and rsc_location.role=Master */
 	node->weight = merge_weights(child->sort_index, node->weight);
 	);
     
     dump_node_scores(LOG_DEBUG_3, rsc, "Middle", rsc->allowed_nodes);
     
     slist_iter(
 	constraint, rsc_colocation_t, rsc->rsc_cons_lhs, lpc,
 	/* (re-)adds location preferences of resource that wish to be
 	 * colocated with the master instance
 	 */
 	if(constraint->role_rh == RSC_ROLE_MASTER) {
 	    rsc->allowed_nodes = constraint->rsc_lh->cmds->merge_weights(
 		constraint->rsc_lh, rsc->id, rsc->allowed_nodes,
 		constraint->node_attribute, constraint->score/INFINITY, TRUE);
 	}
 	);
     
     dump_node_scores(LOG_DEBUG_3, rsc, "After", rsc->allowed_nodes);
 
     /* write them back and sort */
     slist_iter(
 	child, resource_t, rsc->children, lpc,
 
 	chosen = child->fns->location(child, NULL, FALSE);
 
 	if(chosen == NULL || child->sort_index < 0) {
 	    crm_debug_2("%s: %d", child->id, child->sort_index);
 	    continue;
 	}
 
 	node = (node_t*)pe_find_node_id(
 	    rsc->allowed_nodes, chosen->details->id);
 	CRM_ASSERT(node != NULL);
 
 	child->sort_index = node->weight;
 	crm_debug_2("%s: %d", child->id, child->sort_index);
 	);
 
     rsc->children = g_list_sort(rsc->children, sort_master_instance);
 }
 
 int
 master_score(resource_t *rsc, node_t *node, int not_set_value)
 {
 	char *attr_name;
 	char *name = rsc->id;
 	const char *attr_value;
 	int score = not_set_value, len = 0;
 
 	if(rsc->children) {
 	    slist_iter(
 		child, resource_t, rsc->children, lpc,
 		int c_score = master_score(child, node, not_set_value);
 		if(score == not_set_value) {
 		    score = c_score;
 		} else {
 		    score += c_score;
 		}
 	    );
 	    return score;
 	}
 	
 	if(rsc->fns->state(rsc, TRUE) < RSC_ROLE_STARTED) {
 	    return score;
 	}
 
 	if(rsc->running_on) {
 	    node_t *match = pe_find_node_id(rsc->allowed_nodes, node->details->id);
 	    if(match->weight < 0) {
 		crm_debug_2("%s on %s has score: %d - ignoring master pref",
 			    rsc->id, match->details->uname, match->weight);
 		return score;
 	    }
 	}
 	    
 	if(rsc->clone_name) {
 	    /* Use the name the lrm knows this resource as,
 	     * since that's what crm_master would have used too
 	     */
 	    name = rsc->clone_name;
 	}
 
 	len = 8 + strlen(name);
 	crm_malloc0(attr_name, len);
 	sprintf(attr_name, "master-%s", name);
 	
 	crm_debug_3("looking for %s on %s", attr_name,
 				node->details->uname);
 	attr_value = g_hash_table_lookup(
 		node->details->attrs, attr_name);
 	
 	if(attr_value == NULL) {
 		crm_free(attr_name);
 		len = 8 + strlen(rsc->long_name);
 		crm_malloc0(attr_name, len);
 		sprintf(attr_name, "master-%s", rsc->long_name);
 		crm_debug_3("looking for %s on %s", attr_name,
 					node->details->uname);
 		attr_value = g_hash_table_lookup(
 			node->details->attrs, attr_name);
 	}
 	
 	if(attr_value != NULL) {
 		crm_debug_2("%s[%s] = %s", attr_name,
 			    node->details->uname, crm_str(attr_value));
 		score = char2score(attr_value);
 	}
 
 	crm_free(attr_name);
 	return score;
 }
 
 #define max(a, b) a<b?b:a
 
 static void
 apply_master_prefs(resource_t *rsc) 
 {
     int score, new_score;
     clone_variant_data_t *clone_data = NULL;
     get_clone_variant_data(clone_data, rsc);
     
     if(clone_data->applied_master_prefs) {
 	/* Make sure we only do this once */
 	return;
     }
     
     clone_data->applied_master_prefs = TRUE;
     
     slist_iter(
 	child_rsc, resource_t, rsc->children, lpc,
 	slist_iter(
 	    node, node_t, child_rsc->allowed_nodes, lpc,
 
 	    if(can_run_resources(node) == FALSE) {
 		/* This node will never be promoted to master,
 		 *  so don't apply the master score as that may
 		 *  lead to clone shuffling
 		 */
 		continue;
 	    }
 	    
 	    score = master_score(child_rsc, node, 0);
-	    
-	    new_score = merge_weights(node->weight, score);
-	    if(new_score != node->weight) {
-		crm_debug_2("\t%s: Updating preference for %s (%d->%d)",
-			  child_rsc->id, node->details->uname, node->weight, new_score);
-		node->weight = new_score;
+	    if(score > 0) {
+		new_score = merge_weights(node->weight, score);
+		if(new_score != node->weight) {
+		    crm_debug_2("\t%s: Updating preference for %s (%d->%d)",
+				child_rsc->id, node->details->uname, node->weight, new_score);
+		    node->weight = new_score;
+		}
 	    }
 	    
 	    new_score = max(child_rsc->priority, score);
 	    if(new_score != child_rsc->priority) {
 		crm_debug_2("\t%s: Updating priority (%d->%d)",
 			  child_rsc->id, child_rsc->priority, new_score);
 		child_rsc->priority = new_score;
 	    }
 	    );
 	);
 }
 
 static void set_role(resource_t *rsc, enum rsc_role_e role, gboolean current) 
 {
     if(current) {
 	if(rsc->variant == pe_native && rsc->running_on != NULL && rsc->role > role) {
 	    crm_debug_6("Filtering change %s.role = %s (was %s)", rsc->id, role2text(role), role2text(rsc->role));
 
 	} else if(rsc->role < role) {
 	    crm_debug_5("Set %s.role = %s (was %s)", rsc->id, role2text(role), role2text(rsc->role));
 	    rsc->role = role;
 	}
     } else {
 	if(rsc->next_role < role) {
 	    crm_debug_5("Set %s.next_role = %s (was %s)", rsc->id, role2text(role), role2text(rsc->next_role));
 	    rsc->next_role = role;
 	}
     }
     
     slist_iter(
 	child_rsc, resource_t, rsc->children, lpc,
 	set_role(child_rsc, role, current);
 	);
 }
 
 node_t *
 master_color(resource_t *rsc, pe_working_set_t *data_set)
 {
 	int promoted = 0;
 	node_t *chosen = NULL;
 	node_t *cons_node = NULL;
 	enum rsc_role_e next_role = RSC_ROLE_UNKNOWN;
 	
 	clone_variant_data_t *clone_data = NULL;
 	get_clone_variant_data(clone_data, rsc);
 
 	apply_master_prefs(rsc);
 
 	clone_color(rsc, data_set);
 	
 	/* count now tracks the number of masters allocated */
 	slist_iter(node, node_t, rsc->allowed_nodes, lpc,
 		   node->count = 0;
 		);
 
 	/*
 	 * assign priority
 	 */
 	slist_iter(
 		child_rsc, resource_t, rsc->children, lpc,
 
 		GListPtr list = NULL;
 		crm_debug_2("Assigning priority for %s", child_rsc->id);
 
 		if(child_rsc->fns->state(child_rsc, TRUE) == RSC_ROLE_STARTED) {
 		    set_role(child_rsc, RSC_ROLE_SLAVE, TRUE);
 		}
 
 		chosen = child_rsc->fns->location(child_rsc, &list, FALSE);
 		if(g_list_length(list) > 1) {
 		    crm_config_err("Cannot promote non-colocated child %s", child_rsc->id);
 		}
 
 		g_list_free(list);
 		if(chosen == NULL) {
 			continue;
 		}
 		
 		next_role = child_rsc->fns->state(child_rsc, FALSE);
 		switch(next_role) {
 			case RSC_ROLE_STARTED:
 				CRM_CHECK(chosen != NULL, break);
 				/*
 				 * Default to -1 if no value is set
 				 *
 				 * This allows master locations to be specified
 				 * based solely on rsc_location constraints,
 				 * but prevents anyone from being promoted if
 				 * neither a constraint nor a master-score is present
 				 */
 				child_rsc->priority = master_score(child_rsc, chosen, -1);
 				break;
 
 			case RSC_ROLE_SLAVE:
 			case RSC_ROLE_STOPPED:
 				child_rsc->priority = -INFINITY;
 				break;
 			case RSC_ROLE_MASTER:
 				/* the only reason we should be here is if
 				 * we're re-creating actions after a stonith
 				 */
 				promoted++;
 				break;
 			default:
 				CRM_CHECK(FALSE/* unhandled */,
 					  crm_err("Unknown resource role: %d for %s",
 						  next_role, child_rsc->id));
 		}
 
 		apply_master_location(child_rsc->rsc_location);
 		apply_master_location(rsc->rsc_location);
 		slist_iter(
 		    cons, rsc_colocation_t, child_rsc->rsc_cons, lpc2,
 		    child_rsc->cmds->rsc_colocation_lh(child_rsc, cons->rsc_rh, cons);
 		    );
 		
 		child_rsc->sort_index = child_rsc->priority;
 		crm_debug_2("Assigning priority for %s: %d", child_rsc->id, child_rsc->priority);
 
 		if(next_role == RSC_ROLE_MASTER) {
 		    child_rsc->sort_index = INFINITY;
 		}
 
 	    );
 
 	master_promotion_order(rsc);
 
 	/* mark the first N as masters */
 	slist_iter(
 		child_rsc, resource_t, rsc->children, lpc,
 
 		chosen = child_rsc->fns->location(child_rsc, NULL, FALSE);
 		if(show_scores) {
 		    fprintf(stdout, "%s promotion score on %s: %d\n",
 			    child_rsc->id, chosen?chosen->details->uname:"none", child_rsc->sort_index);
 		    
 		} else {
 		    do_crm_log_unlikely(scores_log_level, "%s promotion score on %s: %d",
 			       child_rsc->id, chosen?chosen->details->uname:"none", child_rsc->sort_index);
 		}
 
 		chosen = NULL; /* nuke 'chosen' so that we don't promote more than the
 				* required number of instances
 				*/
 		
 		if(promoted < clone_data->master_max || is_not_set(rsc->flags, pe_rsc_managed)) {
 			chosen = can_be_master(child_rsc);
 		}
 
 		crm_debug("%s master score: %d", child_rsc->id, child_rsc->priority);
 		
 		if(chosen == NULL) {
 		    next_role = child_rsc->fns->state(child_rsc, FALSE);
 		    if(next_role == RSC_ROLE_STARTED) {
 			set_role(child_rsc, RSC_ROLE_SLAVE, FALSE);
 		    }
 		    continue;
 		}
 
 		chosen->count++;
 		crm_info("Promoting %s (%s %s)",
 			 child_rsc->id, role2text(child_rsc->role), chosen->details->uname);
 		set_role(child_rsc, RSC_ROLE_MASTER, FALSE);
 		clone_data->masters_allocated++;
 		promoted++;		
 		);
 	
 	crm_info("%s: Promoted %d instances of a possible %d to master",
 		 rsc->id, promoted, clone_data->master_max);
 	return NULL;
 }
 
 void master_create_actions(resource_t *rsc, pe_working_set_t *data_set)
 {
 	action_t *action = NULL;
 	action_t *action_complete = NULL;
 	gboolean any_promoting = FALSE;
 	gboolean any_demoting = FALSE;
 	resource_t *last_promote_rsc = NULL;
 	resource_t *last_demote_rsc = NULL;
 
 	clone_variant_data_t *clone_data = NULL;
 	get_clone_variant_data(clone_data, rsc);
 	
 	crm_debug("Creating actions for %s", rsc->id);
 
 	/* create actions as normal */
 	clone_create_actions(rsc, data_set);
 
 	slist_iter(
 		child_rsc, resource_t, rsc->children, lpc,
 		gboolean child_promoting = FALSE;
 		gboolean child_demoting = FALSE;
 
 		crm_debug_2("Creating actions for %s", child_rsc->id);
 		child_rsc->cmds->create_actions(child_rsc, data_set);
 		master_update_pseudo_status(
 			child_rsc, &child_demoting, &child_promoting);
 
 		any_demoting = any_demoting || child_demoting;
 		any_promoting = any_promoting || child_promoting;
 		crm_debug_2("Created actions for %s: %d %d", child_rsc->id, child_promoting, child_demoting);
 		);
 	
 	/* promote */
 	action = promote_action(rsc, NULL, !any_promoting);
 	action_complete = custom_action(
 		rsc, promoted_key(rsc),
 		RSC_PROMOTED, NULL, !any_promoting, TRUE, data_set);
 
 	action->pseudo = TRUE;
 	action->runnable = FALSE;
 	action_complete->pseudo = TRUE;
 	action_complete->runnable = FALSE;
 	action_complete->priority = INFINITY;
 
 	if(clone_data->masters_allocated > 0) {
 	    action->runnable = TRUE;
 	    action_complete->runnable = TRUE;
 	}
 	
 	child_promoting_constraints(clone_data, pe_order_optional, 
 				    rsc, NULL, last_promote_rsc, data_set);
 
 	clone_data->promote_notify = create_notification_boundaries(
 	    rsc, RSC_PROMOTE, action, action_complete, data_set);
 
 	/* demote */
 	action = demote_action(rsc, NULL, !any_demoting);
 	action_complete = custom_action(
 		rsc, demoted_key(rsc),
 		RSC_DEMOTED, NULL, !any_demoting, TRUE, data_set);
 	action_complete->priority = INFINITY;
 
 	action->pseudo = TRUE;
 	action->runnable = TRUE;
 	action_complete->pseudo = TRUE;
 	action_complete->runnable = TRUE;
 	
 	child_demoting_constraints(clone_data, pe_order_optional,
 				   rsc, NULL, last_demote_rsc, data_set);
 
 	clone_data->demote_notify = create_notification_boundaries(
 	    rsc, RSC_DEMOTE, action, action_complete, data_set);
 
 	if(clone_data->promote_notify) {
 	    /* If we ever wanted groups to have notifications we'd need to move this to native_internal_constraints() one day
 	     * Requires exposing *_notify
 	     */
 	    order_actions(clone_data->stop_notify->post_done,   clone_data->promote_notify->pre, pe_order_optional);
 	    order_actions(clone_data->start_notify->post_done,  clone_data->promote_notify->pre, pe_order_optional);
 	    order_actions(clone_data->demote_notify->post_done, clone_data->promote_notify->pre, pe_order_optional);
 	    order_actions(clone_data->demote_notify->post_done, clone_data->start_notify->pre,   pe_order_optional);
 	    order_actions(clone_data->demote_notify->post_done, clone_data->stop_notify->pre,    pe_order_optional);
 	}
 	
 	/* restore the correct priority */ 
 	slist_iter(
 		child_rsc, resource_t, rsc->children, lpc,
 		child_rsc->priority = rsc->priority;
 	    );
 }
 
 void
 master_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
 {
 	resource_t *last_rsc = NULL;	
 	clone_variant_data_t *clone_data = NULL;
 	get_clone_variant_data(clone_data, rsc);
 
 	clone_internal_constraints(rsc, data_set);
 	
 	/* global stopped before start */
 	new_rsc_order(rsc, RSC_STOPPED, rsc, RSC_START, pe_order_optional, data_set);
 
 	/* global stopped before promote */
 	new_rsc_order(rsc, RSC_STOPPED, rsc, RSC_PROMOTE, pe_order_optional, data_set);
 
 	/* global demoted before start */
 	new_rsc_order(rsc, RSC_DEMOTED, rsc, RSC_START, pe_order_optional, data_set);
 
 	/* global started before promote */
 	new_rsc_order(rsc, RSC_STARTED, rsc, RSC_PROMOTE, pe_order_optional, data_set);
 
 	/* global demoted before stop */
 	new_rsc_order(rsc, RSC_DEMOTED, rsc, RSC_STOP, pe_order_optional, data_set);
 
 	/* global demote before demoted */
 	new_rsc_order(rsc, RSC_DEMOTE, rsc, RSC_DEMOTED, pe_order_optional, data_set);
 
 	/* global demoted before promote */
 	new_rsc_order(rsc, RSC_DEMOTED, rsc, RSC_PROMOTE, pe_order_optional, data_set);
 
 	slist_iter(
 		child_rsc, resource_t, rsc->children, lpc,
 
 		/* child demote before promote */
 		new_rsc_order(child_rsc, RSC_DEMOTE, child_rsc, RSC_PROMOTE, pe_order_optional, data_set);
 		
 		child_promoting_constraints(clone_data, pe_order_optional,
 					    rsc, child_rsc, last_rsc, data_set);
 
 		child_demoting_constraints(clone_data, pe_order_optional,
 					   rsc, child_rsc, last_rsc, data_set);
 
 		last_rsc = child_rsc;
 		
 		);
 	
 }
 
 static void node_list_update_one(GListPtr list, node_t *other, const char *attr, int score)
 {
     const char *value = NULL;
     
     if(other == NULL) {
 	return;
 
     } else if(attr == NULL) {
 	attr = "#"XML_ATTR_UNAME;
     }
     
     value = g_hash_table_lookup(other->details->attrs, attr);
     slist_iter(node, node_t, list, lpc,
 	       const char *tmp = g_hash_table_lookup(node->details->attrs, attr);
 	       if(safe_str_eq(value, tmp)) {
 		   crm_debug_2("%s: %d + %d", node->details->uname, node->weight, other->weight);
 		   node->weight = merge_weights(node->weight, score);
 	       }
 	);
 }
 
 void master_rsc_colocation_rh(
     resource_t *rsc_lh, resource_t *rsc_rh, rsc_colocation_t *constraint)
 {
 	clone_variant_data_t *clone_data = NULL;
 	get_clone_variant_data(clone_data, rsc_rh);
 
 	
 	CRM_CHECK(rsc_rh != NULL, return);
 	if(is_set(rsc_rh->flags, pe_rsc_provisional)) {
 		return;
 
 	} else if(constraint->role_rh == RSC_ROLE_UNKNOWN) {
 		crm_debug_3("Handling %s as a clone colocation", constraint->id);
 		clone_rsc_colocation_rh(rsc_lh, rsc_rh, constraint);
 		return;
 	}
 	
 	CRM_CHECK(rsc_lh != NULL, return);
 	CRM_CHECK(rsc_lh->variant == pe_native, return);
 	crm_debug_2("Processing constraint %s: %d", constraint->id, constraint->score);
 
 	if(constraint->role_rh == RSC_ROLE_UNKNOWN) {
 		slist_iter(
 			child_rsc, resource_t, rsc_rh->children, lpc,
 			
 			child_rsc->cmds->rsc_colocation_rh(rsc_lh, child_rsc, constraint);
 			);
 
 	} else if(is_set(rsc_lh->flags, pe_rsc_provisional)) {
 		GListPtr lhs = NULL, rhs = NULL;
 		lhs = rsc_lh->allowed_nodes;
 		slist_iter(
 			child_rsc, resource_t, rsc_rh->children, lpc,
 			node_t *chosen = child_rsc->fns->location(child_rsc, NULL, FALSE);
 			enum rsc_role_e next_role = child_rsc->fns->state(child_rsc, FALSE);
 			crm_debug_3("Processing: %s", child_rsc->id);
 			if(chosen != NULL && next_role == constraint->role_rh) {
 			    crm_debug_3("Applying: %s %s %s %d", child_rsc->id,
 					role2text(next_role), chosen->details->uname, constraint->score);
 			    if(constraint->score < INFINITY) {
 				node_list_update_one(rsc_lh->allowed_nodes, chosen,
 						     constraint->node_attribute, constraint->score);
 			    }
 			    rhs = g_list_append(rhs, chosen);
 			}
 			);
 
 		/* Only do this if its not a master-master colocation
 		 * Doing this unconditionally would prevent the slaves from being started
 		 */
 		if(constraint->role_lh != RSC_ROLE_MASTER
 		   || constraint->role_rh != RSC_ROLE_MASTER) {
 		    if(constraint->score > 0) {
 			rsc_lh->allowed_nodes = node_list_exclude(lhs, rhs);
 			pe_free_shallow(lhs);
 		    }
 		}
 		pe_free_shallow_adv(rhs, FALSE);
 
 	} else if(constraint->role_lh == RSC_ROLE_MASTER) {
 	    resource_t *rh_child = find_compatible_child(rsc_lh, rsc_rh, constraint->role_rh, FALSE);
 	    if(rh_child == NULL && constraint->score >= INFINITY) {
 		crm_debug_2("%s can't be promoted %s", rsc_lh->id, constraint->id);
 		rsc_lh->priority = -INFINITY;
 		
 	    } else if(rh_child != NULL) {
 		int new_priority = merge_weights(rsc_lh->priority, constraint->score);
 		crm_debug("Applying %s to %s", constraint->id, rsc_lh->id);
 		crm_debug("\t%s: %d->%d", rsc_lh->id, rsc_lh->priority, new_priority);
 		rsc_lh->priority = new_priority;
 	    }
 	}
 
 	return;
 }
diff --git a/pengine/regression.sh b/pengine/regression.sh
index 1098882827..75a78af2af 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -1,326 +1,327 @@
 #!/bin/bash
 
  # Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
  # 
  # This program is free software; you can redistribute it and/or
  # modify it under the terms of the GNU General Public
  # License as published by the Free Software Foundation; either
  # version 2.1 of the License, or (at your option) any later version.
  # 
  # This software is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  # General Public License for more details.
  # 
  # You should have received a copy of the GNU General Public
  # License along with this library; if not, write to the Free Software
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  #
 if [ -x /usr/bin/valgrind ]; then
     export G_SLICE=always-malloc
     VALGRIND_CMD="valgrind -q --show-reachable=no --leak-check=full --trace-children=no --time-stamp=yes --num-callers=20 --suppressions=./ptest.supp"
 fi
 
 . regression.core.sh
 create_mode="true"
 echo Generating test outputs for these tests...
 # do_test file description
 echo Done.
 echo ""
 
 echo Performing the following tests...
 create_mode="false"
 
 echo ""
 do_test simple1 "Offline     "
 do_test simple2 "Start       "
 do_test simple3 "Start 2     "
 do_test simple4 "Start Failed"
 do_test simple6 "Stop Start  "
 do_test simple7 "Shutdown    "
 #do_test simple8 "Stonith	"
 #do_test simple9 "Lower version"
 #do_test simple10 "Higher version"
 do_test simple11 "Priority (ne)"
 do_test simple12 "Priority (eq)"
 do_test simple8 "Stickiness"
 
 echo ""
 do_test params-0 "Params: No change"
 do_test params-1 "Params: Changed"
 do_test params-2 "Params: Resource definition"
 do_test params-4 "Params: Reload"
 do_test novell-251689 "Resource definition change + target_role=stopped"
 do_test bug-lf-2106 "Restart all anonymous clone instances after config change"
 
 echo ""
 do_test orphan-0 "Orphan ignore"
 do_test orphan-1 "Orphan stop"
 
 echo ""
 do_test target-0 "Target Role : baseline"
 do_test target-1 "Target Role : test"
 
 echo ""
 do_test date-1 "Dates" -d "2005-020"
 do_test date-2 "Date Spec - Pass" -d "2005-020T12:30"
 do_test date-3 "Date Spec - Fail" -d "2005-020T11:30"
 do_test probe-0 "Probe (anon clone)"
 do_test probe-1 "Pending Probe"
 do_test probe-2 "Correctly re-probe cloned groups"
 do_test standby "Standby"
 do_test comments "Comments"
 
 echo ""
 do_test rsc_dep1 "Must not     "
 do_test rsc_dep3 "Must         "
 do_test rsc_dep5 "Must not 3   "
 do_test rsc_dep7 "Must 3       "
 do_test rsc_dep10 "Must (but cant)"
 do_test rsc_dep2  "Must (running) "
 do_test rsc_dep8  "Must (running : alt) "
 do_test rsc_dep4  "Must (running + move)"
 do_test asymmetric "Asymmetric - require explicit location constraints"
 
 echo ""
 do_test order1 "Order start 1     "
 do_test order2 "Order start 2     "
 do_test order3 "Order stop	  "
 do_test order4 "Order (multiple)  "
 do_test order5 "Order (move)  "
 do_test order6 "Order (move w/ restart)  "
 do_test order7 "Order (manditory)  "
 do_test order-optional "Order (score=0)  "
 do_test order-required "Order (score=INFINITY)  "
 do_test bug-lf-2171 "Prevent group start when clone is stopped"
 
 echo ""
 do_test coloc-loop "Colocation - loop"
 do_test coloc-many-one "Colocation - many-to-one"
 do_test coloc-list "Colocation - many-to-one with list"
 do_test coloc-group "Colocation - groups"
 do_test coloc-slave-anti "Anti-colocation with slave shouldn't prevent master colocation"
 do_test coloc-attr "Colocation based on node attributes"
 
 #echo ""
 #do_test agent1 "version: lt (empty)"
 #do_test agent2 "version: eq	"
 #do_test agent3 "version: gt	"
 
 echo ""
 do_test attrs1 "string: eq (and)     "
 do_test attrs2 "string: lt / gt (and)"
 do_test attrs3 "string: ne (or)      "
 do_test attrs4 "string: exists       "
 do_test attrs5 "string: not_exists   "
 do_test attrs6 "is_dc: true          "
 do_test attrs7 "is_dc: false         "
 do_test attrs8 "score_attribute      "
 
 echo ""
 do_test mon-rsc-1 "Schedule Monitor - start"
 do_test mon-rsc-2 "Schedule Monitor - move "
 do_test mon-rsc-3 "Schedule Monitor - pending start     "
 do_test mon-rsc-4 "Schedule Monitor - move/pending start"
 
 echo ""
 do_test rec-rsc-0 "Resource Recover - no start     "
 do_test rec-rsc-1 "Resource Recover - start        "
 do_test rec-rsc-2 "Resource Recover - monitor      "
 do_test rec-rsc-3 "Resource Recover - stop - ignore"
 do_test rec-rsc-4 "Resource Recover - stop - block "
 do_test rec-rsc-5 "Resource Recover - stop - fence "
 do_test rec-rsc-6 "Resource Recover - multiple - restart"
 do_test rec-rsc-7 "Resource Recover - multiple - stop   "
 do_test rec-rsc-8 "Resource Recover - multiple - block  "
 do_test rec-rsc-9 "Resource Recover - group/group"
 
 echo ""
 do_test quorum-1 "No quorum - ignore"
 do_test quorum-2 "No quorum - freeze"
 do_test quorum-3 "No quorum - stop  "
 do_test quorum-4 "No quorum - start anyway"
 do_test quorum-5 "No quorum - start anyway (group)"
 do_test quorum-6 "No quorum - start anyway (clone)"
 
 echo ""
 do_test rec-node-1 "Node Recover - Startup   - no fence"
 do_test rec-node-2 "Node Recover - Startup   - fence   "
 do_test rec-node-3 "Node Recover - HA down   - no fence"
 do_test rec-node-4 "Node Recover - HA down   - fence   "
 do_test rec-node-5 "Node Recover - CRM down  - no fence"
 do_test rec-node-6 "Node Recover - CRM down  - fence   "
 do_test rec-node-7 "Node Recover - no quorum - ignore  "
 do_test rec-node-8 "Node Recover - no quorum - freeze  "
 do_test rec-node-9 "Node Recover - no quorum - stop    "
 do_test rec-node-10 "Node Recover - no quorum - stop w/fence"
 do_test rec-node-11 "Node Recover - CRM down w/ group - fence   "
 do_test rec-node-12 "Node Recover - nothing active - fence   "
 do_test rec-node-13 "Node Recover - failed resource + shutdown - fence   "
 do_test rec-node-15 "Node Recover - unknown lrm section"
 do_test rec-node-14 "Serialize all stonith's"
 
 echo ""
 do_test multi1 "Multiple Active (stop/start)"
 
 echo ""
 do_test migrate-stop "Migration in a stopping stack"
 do_test migrate-start "Migration in a starting stack"
 do_test migrate-stop_start "Migration in a restarting stack"
 do_test migrate-stop-complex "Migration in a complex stopping stack"
 do_test migrate-start-complex "Migration in a complex starting stack"
 
 do_test migrate-1 "Migrate (migrate)"
 do_test migrate-2 "Migrate (stable)"
 do_test migrate-3 "Migrate (failed migrate_to)"
 do_test migrate-4 "Migrate (failed migrate_from)"
 do_test novell-252693 "Migration in a stopping stack"
 do_test novell-252693-2 "Migration in a starting stack"
 do_test novell-252693-3 "Non-Migration in a starting and stopping stack"
 do_test bug-1820 "Migration in a group"
 do_test bug-1820-1 "Non-migration in a group"
 do_test migrate-5 "Primitive migration with a clone"
 
 #echo ""
 #do_test complex1 "Complex	"
 
 echo ""
 do_test group1 "Group		"
 do_test group2 "Group + Native	"
 do_test group3 "Group + Group	"
 do_test group4 "Group + Native (nothing)"
 do_test group5 "Group + Native (move)   "
 do_test group6 "Group + Group (move)    "
 do_test group7 "Group colocation"
 do_test group13 "Group colocation (cant run)"
 do_test group8 "Group anti-colocation"
 do_test group9 "Group recovery"
 do_test group10 "Group partial recovery"
 do_test group11 "Group target_role"
 do_test group14 "Group stop (graph terminated)"
 do_test group15 "-ve group colocation"
 do_test bug-1573 "Partial stop of a group with two children"
 do_test bug-1718 "Mandatory group ordering - Stop group_FUN"
 
 echo ""
 do_test clone-anon-probe-1 "Probe the correct (anonymous) clone instance for each node"
 do_test clone-anon-probe-2 "Avoid needless re-probing of anonymous clones"
 do_test inc0 "Incarnation start" 
 do_test inc1 "Incarnation start order" 
 do_test inc2 "Incarnation silent restart, stop, move"
 do_test inc3 "Inter-incarnation ordering, silent restart, stop, move"
 do_test inc4 "Inter-incarnation ordering, silent restart, stop, move (ordered)"
 do_test inc5 "Inter-incarnation ordering, silent restart, stop, move (restart 1)"
 do_test inc6 "Inter-incarnation ordering, silent restart, stop, move (restart 2)"
 do_test inc7 "Clone colocation"
 do_test inc8 "Clone anti-colocation"
 do_test inc9 "Non-unique clone"
 do_test inc10 "Non-unique clone (stop)"
 do_test inc11 "Primitive colocation with clones" 
 do_test inc12 "Clone shutdown" 
 do_test cloned-group "Make sure only the correct number of cloned groups are started"
 do_test clone-no-shuffle "Dont prioritize allocation of instances that must be moved"
 do_test clone-max-zero "Orphan processing with clone-max=0"
 do_test clone-anon-dup "Bug LF#2087 - Correctly parse the state of anonymous clones that are active more than once per node"
 do_test bug-lf-2160 "Dont shuffle clones due to colocation"
 
 echo ""
 do_test master-0 "Stopped -> Slave"
 do_test master-1 "Stopped -> Promote"
 do_test master-2 "Stopped -> Promote : notify"
 do_test master-3 "Stopped -> Promote : master location"
 do_test master-4 "Started -> Promote : master location"
 do_test master-5 "Promoted -> Promoted"
 do_test master-6 "Promoted -> Promoted (2)"
 do_test master-7 "Promoted -> Fenced"
 do_test master-8 "Promoted -> Fenced -> Moved"
 do_test master-9 "Stopped + Promotable + No quorum"
 do_test master-10 "Stopped -> Promotable : notify with monitor"
 do_test master-11 "Stopped -> Promote : colocation"
 do_test novell-239082 "Demote/Promote ordering"
 do_test novell-239087 "Stable master placement"
 do_test master-12 "Promotion based solely on rsc_location constraints"
 do_test master-13 "Include preferences of colocated resources when placing master"
 do_test master-demote "Ordering when actions depends on demoting a slave resource" 
 do_test master-ordering "Prevent resources from starting that need a master"
 do_test bug-1765 "Master-Master Colocation (dont stop the slaves)"
 do_test master-group "Promotion of cloned groups"
 do_test bug-lf-1852 "Don't shuffle master/slave instances unnecessarily"
 do_test master-failed-demote "Dont retry failed demote actions"
 do_test master-failed-demote-2 "Dont retry failed demote actions (notify=false)"
 do_test master-depend "Ensure resources that depend on the master don't get allocated until the master does"
 do_test master-reattach "Re-attach to a running master"
+do_test master-allow-start "Don't include master score if it would prevent allocation"
 
 echo ""
 do_test managed-0 "Managed (reference)"
 do_test managed-1 "Not managed - down "
 do_test managed-2 "Not managed - up   "
 
 echo ""
 do_test interleave-0 "Interleave (reference)"
 do_test interleave-1 "coloc - not interleaved"
 do_test interleave-2 "coloc - interleaved   "
 do_test interleave-3 "coloc - interleaved (2)"
 do_test interleave-pseudo-stop "Interleaved clone during stonith"
 do_test interleave-stop "Interleaved clone during stop"
 do_test interleave-restart "Interleaved clone during dependancy restart"
 
 echo ""
 do_test notify-0 "Notify reference"
 do_test notify-1 "Notify simple"
 do_test notify-2 "Notify simple, confirm"
 do_test notify-3 "Notify move, confirm"
 do_test novell-239079 "Notification priority"
 #do_test notify-2 "Notify - 764"
 
 echo ""
 do_test 594 "OSDL #594"
 do_test 662 "OSDL #662"
 do_test 696 "OSDL #696"
 do_test 726 "OSDL #726"
 do_test 735 "OSDL #735"
 do_test 764 "OSDL #764"
 do_test 797 "OSDL #797"
 do_test 829 "OSDL #829"
 do_test 994 "OSDL #994"
 do_test 994-2 "OSDL #994 - with a dependant resource"
 do_test 1360 "OSDL #1360 - Clone stickiness"
 do_test 1484 "OSDL #1484 - on_fail=stop"
 do_test 1494 "OSDL #1494 - Clone stability"
 do_test unrunnable-1 "Unrunnable"
 do_test stonith-0 "Stonith loop - 1"
 do_test stonith-1 "Stonith loop - 2"
 do_test stonith-2 "Stonith loop - 3"
 do_test stonith-3 "Stonith startup"
 do_test bug-1572-1 "Recovery of groups depending on master/slave"
 do_test bug-1572-2 "Recovery of groups depending on master/slave when the master is never re-promoted"
 do_test bug-1685 "Depends-on-master ordering"
 do_test bug-1822 "Dont promote partially active groups"
 do_test bug-pm-11 "New resource added to a m/s group"
 do_test bug-pm-12 "Recover only the failed portion of a cloned group"
 do_test bug-n-387749 "Don't shuffle clone instances"
 do_test bug-n-385265 "Don't ignore the failure stickiness of group children - resource_idvscommon should stay stopped"
 do_test bug-n-385265-2 "Ensure groups are migrated instead of remaining partially active on the current node"
 do_test bug-lf-1920 "Correctly handle probes that find active resources"
 do_test bnc-515172 "Location constraint with multiple expressions"
 
 echo ""
 do_test systemhealth1  "System Health ()               #1"
 do_test systemhealth2  "System Health ()               #2"
 do_test systemhealth3  "System Health ()               #3"
 do_test systemhealthn1 "System Health (None)           #1"
 do_test systemhealthn2 "System Health (None)           #2"
 do_test systemhealthn3 "System Health (None)           #3"
 do_test systemhealthm1 "System Health (Migrate On Red) #1"
 do_test systemhealthm2 "System Health (Migrate On Red) #2"
 do_test systemhealthm3 "System Health (Migrate On Red) #3"
 do_test systemhealtho1 "System Health (Only Green)     #1"
 do_test systemhealtho2 "System Health (Only Green)     #2"
 do_test systemhealtho3 "System Health (Only Green)     #3"
 do_test systemhealthp1 "System Health (Progessive)     #1"
 do_test systemhealthp2 "System Health (Progessive)     #2"
 do_test systemhealthp3 "System Health (Progessive)     #3"
 
 echo ""
 
 test_results
diff --git a/pengine/test10/master-allow-start.dot b/pengine/test10/master-allow-start.dot
new file mode 100644
index 0000000000..4b30191d46
--- /dev/null
+++ b/pengine/test10/master-allow-start.dot
@@ -0,0 +1,2 @@
+digraph "g" {
+}
diff --git a/pengine/test10/master-allow-start.exp b/pengine/test10/master-allow-start.exp
new file mode 100644
index 0000000000..b0e6e77e3b
--- /dev/null
+++ b/pengine/test10/master-allow-start.exp
@@ -0,0 +1,2 @@
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="INFINITY" batch-limit="30" transition_id="0"/>
+
diff --git a/pengine/test10/master-allow-start.scores b/pengine/test10/master-allow-start.scores
new file mode 100644
index 0000000000..6d90bcf9af
--- /dev/null
+++ b/pengine/test10/master-allow-start.scores
@@ -0,0 +1,13 @@
+Allocation scores:
+clone_color: ms_res_Stateful_1 allocation score on sles11-a: 0
+clone_color: ms_res_Stateful_1 allocation score on sles11-b: 0
+clone_color: res_Stateful_1:0 allocation score on sles11-a: 11
+clone_color: res_Stateful_1:0 allocation score on sles11-b: 0
+clone_color: res_Stateful_1:1 allocation score on sles11-a: 0
+clone_color: res_Stateful_1:1 allocation score on sles11-b: 1
+native_color: res_Stateful_1:0 allocation score on sles11-a: 11
+native_color: res_Stateful_1:0 allocation score on sles11-b: 0
+native_color: res_Stateful_1:1 allocation score on sles11-a: -1000000
+native_color: res_Stateful_1:1 allocation score on sles11-b: 1
+res_Stateful_1:0 promotion score on sles11-a: 10
+res_Stateful_1:1 promotion score on sles11-b: -5
diff --git a/pengine/test10/master-allow-start.xml b/pengine/test10/master-allow-start.xml
new file mode 100644
index 0000000000..62a09475ac
--- /dev/null
+++ b/pengine/test10/master-allow-start.xml
@@ -0,0 +1,84 @@
+<cib epoch="388" num_updates="2" admin_epoch="0" validate-with="pacemaker-1.0" crm_feature_set="3.0.1" have-quorum="1" cib-last-written="Thu Oct  1 16:53:09 2009" dc-uuid="7a1be228-afbe-426b-9459-5c6e9d377508">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7"/>
+        <nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="Heartbeat"/>
+        <nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="true"/>
+        <nvpair id="cib-bootstrap-options-last-lrm-refresh" name="last-lrm-refresh" value="1254407771"/>
+        <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
+        <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0" uname="sles11-a" type="normal"/>
+      <node id="7a1be228-afbe-426b-9459-5c6e9d377508" uname="sles11-b" type="normal"/>
+    </nodes>
+    <resources>
+      <master id="ms_res_Stateful_1">
+        <meta_attributes id="ms_res_Stateful_1-meta_attributes">
+          <nvpair id="ms_res_Stateful_1-meta_attributes-clone-max" name="clone-max" value="2"/>
+          <nvpair id="ms_res_Stateful_1-meta_attributes-notify" name="notify" value="true"/>
+        </meta_attributes>
+        <primitive class="ocf" id="res_Stateful_1" provider="heartbeat" type="Stateful"/>
+      </master>
+    </resources>
+    <constraints/>
+  </configuration>
+  <status>
+    <node_state id="7a1be228-afbe-426b-9459-5c6e9d377508" uname="sles11-b" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="do_update_resource" shutdown="0">
+      <lrm id="7a1be228-afbe-426b-9459-5c6e9d377508">
+        <lrm_resources>
+          <lrm_resource id="res_Stateful_1:1" type="Stateful" class="ocf" provider="heartbeat">
+            <lrm_rsc_op id="res_Stateful_1:1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="7:0:7:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:7;7:0:7:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="2" rc-code="7" op-status="0" interval="0" last-run="1254408924" last-rc-change="1254408924" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="9:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;9:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="69" rc-code="0" op-status="0" interval="0" last-run="1254409988" last-rc-change="1254409988" exec-time="60" queue-time="10" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_post_notify_start_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="46:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;46:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="70" rc-code="0" op-status="0" interval="0" last-run="1254409988" last-rc-change="1254409988" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_pre_notify_promote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="54:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;54:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="71" rc-code="0" op-status="0" interval="0" last-run="1254409989" last-rc-change="1254409989" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_post_notify_promote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="55:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;55:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="72" rc-code="0" op-status="0" interval="0" last-run="1254409992" last-rc-change="1254409992" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_pre_notify_demote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="61:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;61:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="64" rc-code="0" op-status="0" interval="0" last-run="1254409983" last-rc-change="1254409983" exec-time="60" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_post_notify_demote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="62:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;62:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="66" rc-code="0" op-status="0" interval="0" last-run="1254409984" last-rc-change="1254409984" exec-time="30" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_pre_notify_stop_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="47:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;47:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="67" rc-code="0" op-status="0" interval="0" last-run="1254409985" last-rc-change="1254409985" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_post_notify_stop_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="47:30:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;47:30:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="54" rc-code="0" op-status="0" interval="0" last-run="1254409770" last-rc-change="1254409770" exec-time="100" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_pre_notify_start_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="45:31:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;45:31:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="55" rc-code="0" op-status="0" interval="0" last-run="1254409770" last-rc-change="1254409770" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_promote_0" operation="promote" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="12:32:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;12:32:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="58" rc-code="0" op-status="0" interval="0" last-run="1254409774" last-rc-change="1254409774" exec-time="60" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_demote_0" operation="demote" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="14:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;14:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="65" rc-code="0" op-status="0" interval="0" last-run="1254409984" last-rc-change="1254409984" exec-time="90" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:1_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="9:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;9:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="68" rc-code="0" op-status="0" interval="0" last-run="1254409986" last-rc-change="1254409986" exec-time="60" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+      <transient_attributes id="7a1be228-afbe-426b-9459-5c6e9d377508">
+        <instance_attributes id="status-7a1be228-afbe-426b-9459-5c6e9d377508">
+          <nvpair id="status-7a1be228-afbe-426b-9459-5c6e9d377508-probe_complete" name="probe_complete" value="true"/>
+          <nvpair id="status-7a1be228-afbe-426b-9459-5c6e9d377508-master-res_Stateful_1:1" name="master-res_Stateful_1:1" value="-5"/>
+        </instance_attributes>
+      </transient_attributes>
+    </node_state>
+    <node_state id="70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0" uname="sles11-a" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="do_update_resource" shutdown="0">
+      <lrm id="70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0">
+        <lrm_resources>
+          <lrm_resource id="res_Stateful_1:0" type="Stateful" class="ocf" provider="heartbeat">
+            <lrm_rsc_op id="res_Stateful_1:0_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="4:0:7:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:7;4:0:7:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="2" rc-code="7" op-status="0" interval="0" last-run="1254408924" last-rc-change="1254408924" exec-time="60" queue-time="10" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="5:31:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;5:31:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="60" rc-code="0" op-status="0" interval="0" last-run="1254409771" last-rc-change="1254409771" exec-time="80" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_post_notify_start_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="45:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;45:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="70" rc-code="0" op-status="0" interval="0" last-run="1254409989" last-rc-change="1254409989" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_pre_notify_promote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="52:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;52:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="71" rc-code="0" op-status="0" interval="0" last-run="1254409990" last-rc-change="1254409990" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_promote_0" operation="promote" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="8:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;8:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="72" rc-code="0" op-status="0" interval="0" last-run="1254409992" last-rc-change="1254409992" exec-time="80" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_post_notify_promote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="53:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;53:38:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="73" rc-code="0" op-status="0" interval="0" last-run="1254409993" last-rc-change="1254409993" exec-time="80" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_pre_notify_demote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="59:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;59:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="65" rc-code="0" op-status="0" interval="0" last-run="1254409983" last-rc-change="1254409983" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_demote_0" operation="demote" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="10:29:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;10:29:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="56" rc-code="0" op-status="0" interval="0" last-run="1254409765" last-rc-change="1254409765" exec-time="110" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_post_notify_demote_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="60:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;60:35:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="66" rc-code="0" op-status="0" interval="0" last-run="1254409984" last-rc-change="1254409984" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_pre_notify_stop_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="45:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;45:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="67" rc-code="0" op-status="0" interval="0" last-run="1254409985" last-rc-change="1254409985" exec-time="60" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="5:30:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;5:30:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="59" rc-code="0" op-status="0" interval="0" last-run="1254409769" last-rc-change="1254409769" exec-time="80" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_post_notify_stop_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="46:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;46:36:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="68" rc-code="0" op-status="0" interval="0" last-run="1254409986" last-rc-change="1254409986" exec-time="40" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="res_Stateful_1:0_pre_notify_start_0" operation="notify" crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" transition-key="44:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" transition-magic="0:0;44:37:0:6a6424cf-ee57-48a2-b658-6218a6b6728f" call-id="69" rc-code="0" op-status="0" interval="0" last-run="1254409988" last-rc-change="1254409988" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+      <transient_attributes id="70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0">
+        <instance_attributes id="status-70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0">
+          <nvpair id="status-70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0-probe_complete" name="probe_complete" value="true"/>
+          <nvpair id="status-70172b50-c0c7-4d98-8b7a-d4b6bda7c9b0-master-res_Stateful_1:0" name="master-res_Stateful_1:0" value="10"/>
+        </instance_attributes>
+      </transient_attributes>
+    </node_state>
+  </status>
+</cib>