diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c index 44930337ee..769d3e463c 100644 --- a/lib/pengine/utils.c +++ b/lib/pengine/utils.c @@ -1,1485 +1,1487 @@ /* * Copyright (C) 2004 Andrew Beekhof * * 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 #include #include #include #include #include #include #include extern xmlNode *get_object_root(const char *object_type,xmlNode *the_root); void print_str_str(gpointer key, gpointer value, gpointer user_data); gboolean ghash_free_str_str(gpointer key, gpointer value, gpointer user_data); void unpack_operation( action_t *action, xmlNode *xml_obj, pe_working_set_t* data_set); void pe_free_shallow(GListPtr alist) { pe_free_shallow_adv(alist, TRUE); } void pe_free_shallow_adv(GListPtr alist, gboolean with_data) { GListPtr item; GListPtr item_next = alist; if(with_data == FALSE && alist != NULL) { g_list_free(alist); return; } while(item_next != NULL) { item = item_next; item_next = item_next->next; if(with_data) { /* crm_debug_5("freeing %p", item->data); */ crm_free(item->data); } item->data = NULL; item->next = NULL; g_list_free_1(item); } } node_t * node_copy(node_t *this_node) { node_t *new_node = NULL; CRM_CHECK(this_node != NULL, return NULL); crm_malloc0(new_node, sizeof(node_t)); CRM_ASSERT(new_node != NULL); crm_debug_5("Copying %p (%s) to %p", this_node, this_node->details->uname, new_node); new_node->weight = this_node->weight; new_node->fixed = this_node->fixed; new_node->details = this_node->details; return new_node; } /* are the contents of list1 and list2 equal * nodes with weight < 0 are ignored if filter == TRUE * * slow but linear * */ gboolean node_list_eq(GListPtr list1, GListPtr list2, gboolean filter) { node_t *other_node; GListPtr lhs = list1; GListPtr rhs = list2; slist_iter( node, node_t, lhs, lpc, if(node == NULL || (filter && node->weight < 0)) { continue; } other_node = (node_t*) pe_find_node_id(rhs, node->details->id); if(other_node == NULL || other_node->weight < 0) { return FALSE; } ); lhs = list2; rhs = list1; slist_iter( node, node_t, lhs, lpc, if(node == NULL || (filter && node->weight < 0)) { continue; } other_node = (node_t*) pe_find_node_id(rhs, node->details->id); if(other_node == NULL || other_node->weight < 0) { return FALSE; } ); return TRUE; } /* any node in list1 or list2 and not in the other gets a score of -INFINITY */ GListPtr -node_list_exclude(GListPtr list1, GListPtr list2) +node_list_exclude(GListPtr list1, GListPtr list2, gboolean merge_scores) { node_t *other_node = NULL; GListPtr result = NULL; result = node_list_dup(list1, FALSE, FALSE); slist_iter( node, node_t, result, lpc, other_node = pe_find_node_id(list2, node->details->id); if(other_node == NULL) { node->weight = -INFINITY; - } else { + } else if(merge_scores) { node->weight = merge_weights(node->weight, other_node->weight); } ); slist_iter( node, node_t, list2, lpc, other_node = pe_find_node_id(result, node->details->id); if(other_node == NULL) { node_t *new_node = node_copy(node); new_node->weight = -INFINITY; result = g_list_append(result, new_node); } ); return result; } /* the intersection of list1 and list2 */ GListPtr node_list_and(GListPtr list1, GListPtr list2, gboolean filter) { GListPtr result = NULL; unsigned lpc = 0; for(lpc = 0; lpc < g_list_length(list1); lpc++) { node_t *node = (node_t*)g_list_nth_data(list1, lpc); node_t *other_node = pe_find_node_id(list2, node->details->id); node_t *new_node = NULL; if(other_node != NULL) { new_node = node_copy(node); } if(new_node != NULL) { crm_debug_4("%s: %d + %d", node->details->uname, other_node->weight, new_node->weight); new_node->weight = merge_weights( new_node->weight, other_node->weight); crm_debug_3("New node weight for %s: %d", new_node->details->uname, new_node->weight); if(filter && new_node->weight < 0) { crm_free(new_node); new_node = NULL; } } if(new_node != NULL) { result = g_list_append(result, new_node); } } return result; } /* list1 - list2 */ GListPtr node_list_minus(GListPtr list1, GListPtr list2, gboolean filter) { GListPtr result = NULL; slist_iter( node, node_t, list1, lpc, node_t *other_node = pe_find_node_id(list2, node->details->id); node_t *new_node = NULL; if(node == NULL || other_node != NULL || (filter && node->weight < 0)) { continue; } new_node = node_copy(node); result = g_list_append(result, new_node); ); crm_debug_3("Minus result len: %d", g_list_length(result)); return result; } /* list1 + list2 - (intersection of list1 and list2) */ GListPtr node_list_xor(GListPtr list1, GListPtr list2, gboolean filter) { GListPtr result = NULL; slist_iter( node, node_t, list1, lpc, node_t *new_node = NULL; node_t *other_node = (node_t*) pe_find_node_id(list2, node->details->id); if(node == NULL || other_node != NULL || (filter && node->weight < 0)) { continue; } new_node = node_copy(node); result = g_list_append(result, new_node); ); slist_iter( node, node_t, list2, lpc, node_t *new_node = NULL; node_t *other_node = (node_t*) pe_find_node_id(list1, node->details->id); if(node == NULL || other_node != NULL || (filter && node->weight < 0)) { continue; } new_node = node_copy(node); result = g_list_append(result, new_node); ); crm_debug_3("Xor result len: %d", g_list_length(result)); return result; } GListPtr node_list_or(GListPtr list1, GListPtr list2, gboolean filter) { node_t *other_node = NULL; GListPtr result = NULL; gboolean needs_filter = FALSE; result = node_list_dup(list1, FALSE, filter); slist_iter( node, node_t, list2, lpc, if(node == NULL) { continue; } other_node = (node_t*)pe_find_node_id( result, node->details->id); if(other_node != NULL) { crm_debug_4("%s + %s: %d + %d", node->details->uname, other_node->details->uname, node->weight, other_node->weight); other_node->weight = merge_weights( other_node->weight, node->weight); if(filter && node->weight < 0) { needs_filter = TRUE; } } else if(filter == FALSE || node->weight >= 0) { node_t *new_node = node_copy(node); result = g_list_append(result, new_node); } ); /* not the neatest way, but the most expedient for now */ if(filter && needs_filter) { GListPtr old_result = result; result = node_list_dup(old_result, FALSE, filter); pe_free_shallow_adv(old_result, TRUE); } return result; } GListPtr node_list_dup(GListPtr list1, gboolean reset, gboolean filter) { GListPtr result = NULL; slist_iter( this_node, node_t, list1, lpc, node_t *new_node = NULL; if(filter && this_node->weight < 0) { continue; } new_node = node_copy(this_node); if(reset) { new_node->weight = 0; } if(new_node != NULL) { result = g_list_append(result, new_node); } ); return result; } void dump_node_scores(int level, resource_t *rsc, const char *comment, GListPtr nodes) { GListPtr list = nodes; if(rsc) { list = rsc->allowed_nodes; } if(rsc && is_set(rsc->flags, pe_rsc_orphan)) { /* Don't show the allocation scores for orphans */ return; } slist_iter( node, node_t, list, lpc, + char *score = crm_itoa(node->weight); if(level == 0) { if(rsc) { - fprintf(stdout, "%s: %s allocation score on %s: %d\n", - comment, rsc->id, node->details->uname, node->weight); + fprintf(stdout, "%s: %s allocation score on %s: %s\n", + comment, rsc->id, node->details->uname, score); } else { - fprintf(stdout, "%s: %s = %d\n", comment, node->details->uname, node->weight); + fprintf(stdout, "%s: %s = %s\n", comment, node->details->uname, score); } } else { if(rsc) { - do_crm_log_unlikely(level, "%s: %s allocation score on %s: %d", - comment, rsc->id, node->details->uname, node->weight); + do_crm_log_unlikely(level, "%s: %s allocation score on %s: %s", + comment, rsc->id, node->details->uname, score); } else { - do_crm_log_unlikely(level, "%s: %s = %d", comment, node->details->uname, node->weight); + do_crm_log_unlikely(level, "%s: %s = %s", comment, node->details->uname, score); } } + crm_free(score); ); if(rsc && rsc->children) { slist_iter( child, resource_t, rsc->children, lpc, dump_node_scores(level, child, comment, nodes); ); } } gint sort_rsc_index(gconstpointer a, gconstpointer b) { const resource_t *resource1 = (const resource_t*)a; const resource_t *resource2 = (const resource_t*)b; if(a == NULL && b == NULL) { return 0; } if(a == NULL) { return 1; } if(b == NULL) { return -1; } if(resource1->sort_index > resource2->sort_index) { return -1; } if(resource1->sort_index < resource2->sort_index) { return 1; } return 0; } gint sort_rsc_priority(gconstpointer a, gconstpointer b) { const resource_t *resource1 = (const resource_t*)a; const resource_t *resource2 = (const resource_t*)b; if(a == NULL && b == NULL) { return 0; } if(a == NULL) { return 1; } if(b == NULL) { return -1; } if(resource1->priority > resource2->priority) { return -1; } if(resource1->priority < resource2->priority) { return 1; } return 0; } action_t * custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean save_action, pe_working_set_t *data_set) { action_t *action = NULL; GListPtr possible_matches = NULL; CRM_CHECK(key != NULL, return NULL); CRM_CHECK(task != NULL, return NULL); if(save_action && rsc != NULL) { possible_matches = find_actions(rsc->actions, key, on_node); } if(possible_matches != NULL) { crm_free(key); if(g_list_length(possible_matches) > 1) { pe_warn("Action %s for %s on %s exists %d times", task, rsc?rsc->id:"", on_node?on_node->details->uname:"", g_list_length(possible_matches)); } action = g_list_nth_data(possible_matches, 0); crm_debug_4("Found existing action (%d) %s for %s on %s", action->id, task, rsc?rsc->id:"", on_node?on_node->details->uname:""); g_list_free(possible_matches); } if(action == NULL) { if(save_action) { crm_debug_4("Creating%s action %d: %s for %s on %s", optional?"":" manditory", data_set->action_id, key, rsc?rsc->id:"", on_node?on_node->details->uname:""); } crm_malloc0(action, sizeof(action_t)); if(save_action) { action->id = data_set->action_id++; } else { action->id = 0; } action->rsc = rsc; CRM_ASSERT(task != NULL); action->task = crm_strdup(task); action->node = on_node; action->uuid = key; action->failure_is_fatal = TRUE; action->runnable = TRUE; action->optional = optional; /* Implied by crm_malloc0()... action->actions_before = NULL; action->actions_after = NULL; action->pseudo = FALSE; action->dumped = FALSE; action->processed = FALSE; action->seen_count = 0; */ action->extra = g_hash_table_new_full( g_str_hash, g_str_equal, free, free); action->meta = g_hash_table_new_full( g_str_hash, g_str_equal, free, free); if(save_action) { data_set->actions = g_list_append( data_set->actions, action); } if(rsc != NULL) { action->op_entry = find_rsc_op_entry(rsc, key); unpack_operation( action, action->op_entry, data_set); if(save_action) { rsc->actions = g_list_append( rsc->actions, action); } } if(save_action) { crm_debug_4("Action %d created", action->id); } } if(optional == FALSE && action->optional) { crm_debug_2("Action %d (%s) marked manditory", action->id, action->uuid); action->optional = FALSE; } if(rsc != NULL) { enum action_tasks a_task = text2task(action->task); int warn_level = LOG_DEBUG_3; if(save_action) { warn_level = LOG_WARNING; } if(action->have_node_attrs == FALSE && action->node != NULL && action->op_entry != NULL) { action->have_node_attrs = TRUE; unpack_instance_attributes( data_set->input, action->op_entry, XML_TAG_ATTR_SETS, action->node->details->attrs, action->extra, NULL, FALSE, data_set->now); } if(action->pseudo) { /* leave untouched */ } else if(action->node == NULL) { action->runnable = FALSE; } else if(is_not_set(rsc->flags, pe_rsc_managed) && g_hash_table_lookup(action->meta, XML_LRM_ATTR_INTERVAL) == NULL) { do_crm_log_unlikely(LOG_DEBUG, "Action %s (unmanaged)", action->uuid); action->optional = TRUE; /* action->runnable = FALSE; */ } else if(action->node->details->online == FALSE) { action->runnable = FALSE; do_crm_log(warn_level, "Action %s on %s is unrunnable (offline)", action->uuid, action->node->details->uname); if(is_set(action->rsc->flags, pe_rsc_managed) && save_action && a_task == stop_rsc) { do_crm_log(warn_level, "Marking node %s unclean", action->node->details->uname); action->node->details->unclean = TRUE; } } else if(action->node->details->pending) { action->runnable = FALSE; do_crm_log(warn_level, "Action %s on %s is unrunnable (pending)", action->uuid, action->node->details->uname); } else if(action->needs == rsc_req_nothing) { crm_debug_3("Action %s doesnt require anything", action->uuid); action->runnable = TRUE; #if 0 /* * No point checking this * - if we dont have quorum we cant stonith anyway */ } else if(action->needs == rsc_req_stonith) { crm_debug_3("Action %s requires only stonith", action->uuid); action->runnable = TRUE; #endif } else if(is_set(data_set->flags, pe_flag_have_quorum) == FALSE && data_set->no_quorum_policy == no_quorum_stop) { action->runnable = FALSE; crm_debug("%s\t%s (cancelled : quorum)", action->node->details->uname, action->uuid); } else if(is_set(data_set->flags, pe_flag_have_quorum) == FALSE && data_set->no_quorum_policy == no_quorum_freeze) { crm_debug_3("Check resource is already active"); if(rsc->fns->active(rsc, TRUE) == FALSE) { action->runnable = FALSE; crm_debug("%s\t%s (cancelled : quorum freeze)", action->node->details->uname, action->uuid); } } else { crm_debug_3("Action %s is runnable", action->uuid); action->runnable = TRUE; } if(save_action) { switch(a_task) { case stop_rsc: set_bit(rsc->flags, pe_rsc_stopping); break; case start_rsc: clear_bit(rsc->flags, pe_rsc_starting); if(action->runnable) { set_bit(rsc->flags, pe_rsc_starting); } break; default: break; } } } return action; } void unpack_operation( action_t *action, xmlNode *xml_obj, pe_working_set_t* data_set) { int value_i = 0; unsigned long long interval = 0; unsigned long long start_delay = 0; char *value_ms = NULL; const char *class = NULL; const char *value = NULL; const char *field = NULL; CRM_CHECK(action->rsc != NULL, return); unpack_instance_attributes(data_set->input, data_set->op_defaults, XML_TAG_META_SETS, NULL, action->meta, NULL, FALSE, data_set->now); xml_prop_iter(xml_obj, name, value, if(value != NULL && g_hash_table_lookup(action->meta, name) == NULL) { g_hash_table_insert(action->meta, crm_strdup(name), crm_strdup(value)); } ); unpack_instance_attributes(data_set->input, xml_obj, XML_TAG_META_SETS, NULL, action->meta, NULL, FALSE, data_set->now); unpack_instance_attributes(data_set->input, xml_obj, XML_TAG_ATTR_SETS, NULL, action->meta, NULL, FALSE, data_set->now); g_hash_table_remove(action->meta, "id"); class = g_hash_table_lookup(action->rsc->meta, "class"); value = g_hash_table_lookup(action->meta, "requires"); if(safe_str_eq(class, "stonith")) { action->needs = rsc_req_nothing; value = "nothing (fencing op)"; } else if(value == NULL && safe_str_neq(action->task, CRMD_ACTION_START)) { action->needs = rsc_req_nothing; value = "nothing (default)"; } else if(safe_str_eq(value, "nothing")) { action->needs = rsc_req_nothing; } else if(safe_str_eq(value, "quorum")) { action->needs = rsc_req_quorum; } else if(safe_str_eq(value, "fencing")) { action->needs = rsc_req_stonith; } else if(data_set->no_quorum_policy == no_quorum_ignore || safe_str_eq(class, "stonith")) { action->needs = rsc_req_nothing; value = "nothing (default)"; } else if(data_set->no_quorum_policy == no_quorum_freeze && is_set(data_set->flags, pe_flag_stonith_enabled)) { action->needs = rsc_req_stonith; value = "fencing (default)"; } else { action->needs = rsc_req_quorum; value = "quorum (default)"; } crm_debug_3("\tAction %s requires: %s", action->task, value); value = g_hash_table_lookup(action->meta, XML_OP_ATTR_ON_FAIL); if(safe_str_eq(action->task, CRMD_ACTION_STOP) && safe_str_eq(value, "standby")) { crm_config_err("on-fail=standby is not allowed for stop actions: %s", action->rsc->id); value = NULL; } if(value == NULL) { } else if(safe_str_eq(value, "block")) { action->on_fail = action_fail_block; } else if(safe_str_eq(value, "fence")) { action->on_fail = action_fail_fence; value = "node fencing"; if(is_set(data_set->flags, pe_flag_stonith_enabled) == FALSE) { crm_config_err("Specifying on_fail=fence and" " stonith-enabled=false makes no sense"); action->on_fail = action_fail_stop; action->fail_role = RSC_ROLE_STOPPED; value = "stop resource"; } } else if(safe_str_eq(value, "standby")) { action->on_fail = action_fail_standby; value = "node standby"; } else if(safe_str_eq(value, "ignore") || safe_str_eq(value, "nothing")) { action->on_fail = action_fail_ignore; value = "ignore"; } else if(safe_str_eq(value, "migrate")) { action->on_fail = action_fail_migrate; value = "force migration"; } else if(safe_str_eq(value, "stop")) { action->on_fail = action_fail_stop; action->fail_role = RSC_ROLE_STOPPED; value = "stop resource"; } else if(safe_str_eq(value, "restart")) { action->on_fail = action_fail_recover; value = "restart (and possibly migrate)"; } else { pe_err("Resource %s: Unknown failure type (%s)", action->rsc->id, value); value = NULL; } /* defaults */ if(value == NULL && safe_str_eq(action->task, CRMD_ACTION_STOP)) { if(is_set(data_set->flags, pe_flag_stonith_enabled)) { action->on_fail = action_fail_fence; value = "resource fence (default)"; } else { action->on_fail = action_fail_block; value = "resource block (default)"; } } else if(value == NULL && safe_str_eq(action->task, CRMD_ACTION_MIGRATED)) { action->on_fail = action_migrate_failure; value = "atomic migration recovery (default)"; } else if(value == NULL) { action->on_fail = action_fail_recover; value = "restart (and possibly migrate) (default)"; } crm_debug_3("\t%s failure handling: %s", action->task, value); value = NULL; if(xml_obj != NULL) { value = g_hash_table_lookup(action->meta, "role_after_failure"); } if(value != NULL && action->fail_role == RSC_ROLE_UNKNOWN) { action->fail_role = text2role(value); } /* defaults */ if(action->fail_role == RSC_ROLE_UNKNOWN) { if(safe_str_eq(action->task, CRMD_ACTION_PROMOTE)) { action->fail_role = RSC_ROLE_SLAVE; } else { action->fail_role = RSC_ROLE_STARTED; } } crm_debug_3("\t%s failure results in: %s", action->task, role2text(action->fail_role)); field = XML_LRM_ATTR_INTERVAL; value = g_hash_table_lookup(action->meta, field); if(value != NULL) { interval = crm_get_interval(value); if(interval > 0) { value_ms = crm_itoa(interval); g_hash_table_replace(action->meta, crm_strdup(field), value_ms); } else { g_hash_table_remove(action->meta, field); } } field = XML_OP_ATTR_START_DELAY; value = g_hash_table_lookup(action->meta, field); if(value != NULL) { value_i = crm_get_msec(value); if(value_i < 0) { value_i = 0; } start_delay = value_i; value_ms = crm_itoa(value_i); g_hash_table_replace(action->meta, crm_strdup(field), value_ms); } else if(interval > 0 && g_hash_table_lookup(action->meta, XML_OP_ATTR_ORIGIN)) { char *date_str = NULL; char *date_str_mutable = NULL; ha_time_t *origin = NULL; value = g_hash_table_lookup(action->meta, XML_OP_ATTR_ORIGIN); date_str = crm_strdup(value); date_str_mutable = date_str; origin = parse_date(&date_str_mutable); crm_free(date_str); if(origin == NULL) { crm_config_err("Operation %s contained an invalid "XML_OP_ATTR_ORIGIN": %s", ID(xml_obj), value); } else { ha_time_t *delay = NULL; int rc = compare_date(origin, data_set->now); unsigned long long delay_s = 0; while(rc < 0) { add_seconds(origin, interval/1000); rc = compare_date(origin, data_set->now); } delay = subtract_time(origin, data_set->now); delay_s = date_in_seconds(delay); /* log_date(LOG_DEBUG_5, "delay", delay, ha_log_date|ha_log_time|ha_log_local); */ crm_info("Calculated a start delay of %llus for %s", delay_s, ID(xml_obj)); g_hash_table_replace(action->meta, crm_strdup(XML_OP_ATTR_START_DELAY), crm_itoa(delay_s * 1000)); start_delay = delay_s * 1000; free_ha_date(origin); free_ha_date(delay); } } field = XML_ATTR_TIMEOUT; value = g_hash_table_lookup(action->meta, field); if(value == NULL) { value = pe_pref( data_set->config_hash, "default-action-timeout"); } value_i = crm_get_msec(value); if(value_i < 0) { value_i = 0; } value_i += start_delay; value_ms = crm_itoa(value_i); g_hash_table_replace(action->meta, crm_strdup(field), value_ms); } xmlNode * find_rsc_op_entry(resource_t *rsc, const char *key) { int number = 0; const char *name = NULL; const char *value = NULL; const char *interval = NULL; char *match_key = NULL; xmlNode *op = NULL; xml_child_iter_filter( rsc->ops_xml, operation, "op", name = crm_element_value(operation, "name"); interval = crm_element_value(operation, XML_LRM_ATTR_INTERVAL); value = crm_element_value(operation, "enabled"); if(value && crm_is_true(value) == FALSE) { continue; } number = crm_get_interval(interval); if(number < 0) { continue; } match_key = generate_op_key(rsc->id, name, number); if(safe_str_eq(key, match_key)) { op = operation; } crm_free(match_key); if(op != NULL) { return op; } ); if(strstr(key, CRMD_ACTION_MIGRATE) || strstr(key, CRMD_ACTION_MIGRATED)) { match_key = generate_op_key(rsc->id, "migrate", 0); op = find_rsc_op_entry(rsc, match_key); crm_free(match_key); } if(op == NULL) { crm_debug_3("No match for %s", key); } return op; } void print_node(const char *pre_text, node_t *node, gboolean details) { if(node == NULL) { crm_debug_4("%s%s: ", pre_text==NULL?"":pre_text, pre_text==NULL?"":": "); return; } crm_debug_4("%s%s%sNode %s: (weight=%d, fixed=%s)", pre_text==NULL?"":pre_text, pre_text==NULL?"":": ", node->details==NULL?"error ":node->details->online?"":"Unavailable/Unclean ", node->details->uname, node->weight, node->fixed?"True":"False"); if(details && node != NULL && node->details != NULL) { char *pe_mutable = crm_strdup("\t\t"); crm_debug_4("\t\t===Node Attributes"); g_hash_table_foreach(node->details->attrs, print_str_str, pe_mutable); crm_free(pe_mutable); crm_debug_4("\t\t=== Resources"); slist_iter( rsc, resource_t, node->details->running_rsc, lpc, print_resource(LOG_DEBUG_4, "\t\t", rsc, FALSE); ); } } /* * Used by the HashTable for-loop */ void print_str_str(gpointer key, gpointer value, gpointer user_data) { crm_debug_4("%s%s %s ==> %s", user_data==NULL?"":(char*)user_data, user_data==NULL?"":": ", (char*)key, (char*)value); } void print_resource( int log_level, const char *pre_text, resource_t *rsc, gboolean details) { long options = pe_print_log; if(rsc == NULL) { do_crm_log(log_level-1, "%s%s: ", pre_text==NULL?"":pre_text, pre_text==NULL?"":": "); return; } if(details) { options |= pe_print_details; } rsc->fns->print(rsc, pre_text, options, &log_level); } void pe_free_action(action_t *action) { if(action == NULL) { return; } pe_free_shallow(action->actions_before);/* action_warpper_t* */ pe_free_shallow(action->actions_after); /* action_warpper_t* */ if(action->extra) { g_hash_table_destroy(action->extra); } if(action->meta) { g_hash_table_destroy(action->meta); } crm_free(action->task); crm_free(action->uuid); crm_free(action); } GListPtr find_recurring_actions(GListPtr input, node_t *not_on_node) { const char *value = NULL; GListPtr result = NULL; CRM_CHECK(input != NULL, return NULL); slist_iter( action, action_t, input, lpc, value = g_hash_table_lookup(action->meta, XML_LRM_ATTR_INTERVAL); if(value == NULL) { /* skip */ } else if(safe_str_eq(value, "0")) { /* skip */ } else if(safe_str_eq(CRMD_ACTION_CANCEL, action->task)) { /* skip */ } else if(not_on_node == NULL) { crm_debug_5("(null) Found: %s", action->uuid); result = g_list_append(result, action); } else if(action->node == NULL) { /* skip */ } else if(action->node->details != not_on_node->details) { crm_debug_5("Found: %s", action->uuid); result = g_list_append(result, action); } ); return result; } action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node) { CRM_CHECK(uuid || task, return NULL); slist_iter( action, action_t, input, lpc, if(uuid != NULL && safe_str_neq(uuid, action->uuid)) { continue; } else if(task != NULL && safe_str_neq(task, action->task)) { continue; } else if(on_node == NULL) { return action; } else if(action->node == NULL) { continue; } else if(on_node->details == action->node->details) { return action; } ); return NULL; } GListPtr find_actions(GListPtr input, const char *key, node_t *on_node) { GListPtr result = NULL; CRM_CHECK(key != NULL, return NULL); slist_iter( action, action_t, input, lpc, crm_debug_5("Matching %s against %s", key, action->uuid); if(safe_str_neq(key, action->uuid)) { continue; } else if(on_node == NULL) { result = g_list_append(result, action); } else if(action->node == NULL) { /* skip */ crm_debug_2("While looking for %s action on %s, " "found an unallocated one. Assigning" " it to the requested node...", key, on_node->details->uname); action->node = on_node; result = g_list_append(result, action); } else if(on_node->details == action->node->details) { result = g_list_append(result, action); } ); return result; } GListPtr find_actions_exact(GListPtr input, const char *key, node_t *on_node) { GListPtr result = NULL; CRM_CHECK(key != NULL, return NULL); slist_iter( action, action_t, input, lpc, crm_debug_5("Matching %s against %s", key, action->uuid); if(safe_str_neq(key, action->uuid)) { crm_debug_3("Key mismatch: %s vs. %s", key, action->uuid); continue; } else if(on_node == NULL || action->node == NULL) { crm_debug_3("on_node=%p, action->node=%p", on_node, action->node); continue; } else if(safe_str_eq(on_node->details->id, action->node->details->id)) { result = g_list_append(result, action); } crm_debug_2("Node mismatch: %s vs. %s", on_node->details->id, action->node->details->id); ); return result; } void set_id(xmlNode * xml_obj, const char *prefix, int child) { int id_len = 0; gboolean use_prefix = TRUE; gboolean use_child = TRUE; char *new_id = NULL; const char *id = crm_element_value(xml_obj, XML_ATTR_ID); id_len = 1 + strlen(id); if(child > 999) { pe_err("Are you insane?!?" " The CRM does not support > 1000 children per resource"); return; } else if(child < 0) { use_child = FALSE; } else { id_len += 4; /* child */ } if(prefix == NULL || safe_str_eq(id, prefix)) { use_prefix = FALSE; } else { id_len += (1 + strlen(prefix)); } crm_malloc0(new_id, id_len); if(use_child) { snprintf(new_id, id_len, "%s%s%s:%d", use_prefix?prefix:"", use_prefix?":":"", id, child); } else { snprintf(new_id, id_len, "%s%s%s", use_prefix?prefix:"", use_prefix?":":"", id); } crm_xml_add(xml_obj, XML_ATTR_ID, new_id); crm_free(new_id); } static void resource_node_score(resource_t *rsc, node_t *node, int score, const char *tag) { node_t *match = NULL; if(rsc->children) { slist_iter( child_rsc, resource_t, rsc->children, lpc, resource_node_score(child_rsc, node, score, tag); ); } crm_debug_2("Setting %s for %s on %s: %d", tag, rsc->id, node->details->uname, score); match = pe_find_node_id(rsc->allowed_nodes, node->details->id); if(match == NULL) { match = node_copy(node); match->weight = 0; rsc->allowed_nodes = g_list_append(rsc->allowed_nodes, match); } match->weight = merge_weights(match->weight, score); } void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set) { if(node != NULL) { resource_node_score(rsc, node, score, tag); } else if(data_set != NULL) { slist_iter( node, node_t, data_set->nodes, lpc, resource_node_score(rsc, node, score, tag); ); } else { slist_iter( node, node_t, rsc->allowed_nodes, lpc, resource_node_score(rsc, node, score, tag); ); } if(node == NULL && score == -INFINITY) { if(rsc->allocated_to) { crm_info("Deallocating %s from %s", rsc->id, rsc->allocated_to->details->uname); crm_free(rsc->allocated_to); rsc->allocated_to = NULL; } } } #define sort_return(an_int) crm_free(a_uuid); crm_free(b_uuid); return an_int gint sort_op_by_callid(gconstpointer a, gconstpointer b) { char *a_uuid = NULL; char *b_uuid = NULL; const xmlNode *xml_a = a; const xmlNode *xml_b = b; const char *a_xml_id = crm_element_value_const(xml_a, XML_ATTR_ID); const char *b_xml_id = crm_element_value_const(xml_b, XML_ATTR_ID); const char *a_task_id = crm_element_value_const(xml_a, XML_LRM_ATTR_CALLID); const char *b_task_id = crm_element_value_const(xml_b, XML_LRM_ATTR_CALLID); const char *a_key = crm_element_value_const(xml_a, XML_ATTR_TRANSITION_MAGIC); const char *b_key = crm_element_value_const(xml_b, XML_ATTR_TRANSITION_MAGIC); int dummy = -1; int a_id = -1; int b_id = -1; int a_rc = -1; int b_rc = -1; int a_status = -1; int b_status = -1; int a_call_id = -1; int b_call_id = -1; if(safe_str_eq(a_xml_id, b_xml_id)) { /* We have duplicate lrm_rsc_op entries in the status * section which is unliklely to be a good thing * - we can handle it easily enough, but we need to get * to the bottom of why its happening. */ pe_err("Duplicate lrm_rsc_op entries named %s", a_xml_id); sort_return(0); } CRM_CHECK(a_task_id != NULL && b_task_id != NULL, crm_err("a: %s, b: %s", crm_str(a_xml_id), crm_str(b_xml_id)); sort_return(0)); a_call_id = crm_parse_int(a_task_id, NULL); b_call_id = crm_parse_int(b_task_id, NULL); if(a_call_id == -1 && b_call_id == -1) { /* both are pending ops so it doesnt matter since * stops are never pending */ sort_return(0); } else if(a_call_id >= 0 && a_call_id < b_call_id) { crm_debug_4("%s (%d) < %s (%d) : call id", a_xml_id, a_call_id, b_xml_id, b_call_id); sort_return(-1); } else if(b_call_id >= 0 && a_call_id > b_call_id) { crm_debug_4("%s (%d) > %s (%d) : call id", a_xml_id, a_call_id, b_xml_id, b_call_id); sort_return(1); } crm_debug_5("%s (%d) == %s (%d) : continuing", a_xml_id, a_call_id, b_xml_id, b_call_id); /* now process pending ops */ CRM_CHECK(a_key != NULL && b_key != NULL, sort_return(0)); CRM_CHECK(decode_transition_magic( a_key, &a_uuid, &a_id, &dummy, &a_status, &a_rc, &dummy), sort_return(0)); CRM_CHECK(decode_transition_magic( b_key, &b_uuid, &b_id, &dummy, &b_status, &b_rc, &dummy), sort_return(0)); /* try and determin the relative age of the operation... * some pending operations (ie. a start) may have been supuerceeded * by a subsequent stop * * [a|b]_id == -1 means its a shutdown operation and _always_ comes last */ if(safe_str_neq(a_uuid, b_uuid) || a_id == b_id) { /* * some of the logic in here may be redundant... * * if the UUID from the TE doesnt match then one better * be a pending operation. * pending operations dont survive between elections and joins * because we query the LRM directly */ CRM_CHECK(a_call_id == -1 || b_call_id == -1, crm_err("a: %s=%d, b: %s=%d", crm_str(a_xml_id), a_call_id, crm_str(b_xml_id), b_call_id); sort_return(0)); CRM_CHECK(a_call_id >= 0 || b_call_id >= 0, sort_return(0)); if(b_call_id == -1) { crm_debug_2("%s (%d) < %s (%d) : transition + call id", a_xml_id, a_call_id, b_xml_id, b_call_id); sort_return(-1); } if(a_call_id == -1) { crm_debug_2("%s (%d) > %s (%d) : transition + call id", a_xml_id, a_call_id, b_xml_id, b_call_id); sort_return(1); } } else if((a_id >= 0 && a_id < b_id) || b_id == -1) { crm_debug_3("%s (%d) < %s (%d) : transition", a_xml_id, a_id, b_xml_id, b_id); sort_return(-1); } else if((b_id >= 0 && a_id > b_id) || a_id == -1) { crm_debug_3("%s (%d) > %s (%d) : transition", a_xml_id, a_id, b_xml_id, b_id); sort_return(1); } /* we should never end up here */ crm_err("%s (%d:%d:%s) ?? %s (%d:%d:%s) : default", a_xml_id, a_call_id, a_id, a_uuid, b_xml_id, b_call_id, b_id, b_uuid); CRM_CHECK(FALSE, sort_return(0)); } time_t get_timet_now(pe_working_set_t *data_set) { time_t now = 0; if(data_set && data_set->now) { now = data_set->now->tm_now; } if(now == 0) { /* eventually we should convert data_set->now into time_tm * for now, its only triggered by PE regression tests */ now = time(NULL); crm_crit("Defaulting to 'now'"); if(data_set && data_set->now) { data_set->now->tm_now = now; } } return now; } struct fail_search { resource_t *rsc; int count; long long last; char *key; }; static void get_failcount_by_prefix(gpointer key_p, gpointer value, gpointer user_data) { struct fail_search *search = user_data; const char *key = key_p; const char *match = strstr(key, search->key); if(match) { if(strstr(key, "last-failure-") == key && (key+13) == match) { search->last = crm_int_helper(value, NULL); } else if(strstr(key, "fail-count-") == key && (key+11) == match) { search->count += char2score(value); } else { crm_err("Unknown key: %s, %p, %p %p", key, match, (key+13), (key+11)); } } } int get_failcount(node_t *node, resource_t *rsc, int *last_failure, pe_working_set_t *data_set) { struct fail_search search = {rsc, 0, 0, NULL}; search.key = crm_strdup(rsc->id); if(is_not_set(rsc->flags, pe_rsc_unique)) { int lpc = 0; search.rsc = uber_parent(rsc); /* Strip the clone incarnation */ for(lpc = strlen(search.key); lpc > 0; lpc--) { if(search.key[lpc] == ':') { search.key[lpc+1] = 0; break; } } g_hash_table_foreach(node->details->attrs, get_failcount_by_prefix, &search); } else { /* Optimize the "normal" case */ char *key = NULL; const char *value = NULL; key = crm_concat("fail-count", rsc->id, '-'); value = g_hash_table_lookup(node->details->attrs, key); search.count = char2score(value); crm_free(key); key = crm_concat("last-failure", rsc->id, '-'); value = g_hash_table_lookup(node->details->attrs, key); search.last = crm_int_helper(value, NULL); crm_free(key); } if(search.count != 0 && search.last != 0 && rsc->failure_timeout) { if(last_failure) { *last_failure = search.last; } if(search.last > 0) { time_t now = get_timet_now(data_set); if(now > (search.last + rsc->failure_timeout)) { crm_notice("Failcount for %s on %s has expired (limit was %ds)", search.rsc->id, node->details->uname, rsc->failure_timeout); search.count = 0; } } } if(search.count != 0) { crm_info("%s has failed %s times on %s", search.rsc->id, score2char(search.count), node->details->uname); } crm_free(search.key); return search.count; } gboolean get_target_role(resource_t *rsc, enum rsc_role_e *role) { const char *value = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_TARGET_ROLE); CRM_CHECK(role != NULL, return FALSE); if(value == NULL || safe_str_eq("started", value) || safe_str_eq("default", value)) { return FALSE; } *role = text2role(value); if(*role == RSC_ROLE_UNKNOWN) { crm_config_err("%s: Unknown value for %s: %s", rsc->id, XML_RSC_ATTR_TARGET_ROLE, value); return FALSE; } else if(*role > RSC_ROLE_STARTED) { const char *stateful = g_hash_table_lookup(rsc->meta, "stateful"); if(rsc->variant == pe_master) { /* Next check isn't true during common_unpack() for the master */ } else if(crm_is_true(stateful) == FALSE) { pe_warn("%s is not part of a master/slave resource, a %s of '%s' makes no sense: %s", rsc->id, XML_RSC_ATTR_TARGET_ROLE, value, stateful); *role = RSC_ROLE_STARTED; return FALSE; } } return TRUE; } diff --git a/lib/pengine/utils.h b/lib/pengine/utils.h index 9d55d9531d..83a2a7f447 100644 --- a/lib/pengine/utils.h +++ b/lib/pengine/utils.h @@ -1,129 +1,129 @@ /* * Copyright (C) 2004 Andrew Beekhof * * 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 */ #ifndef PE_UTILS__H #define PE_UTILS__H #include #include extern node_t *node_copy(node_t *this_node) ; extern time_t get_timet_now(pe_working_set_t *data_set); extern int get_failcount(node_t *node, resource_t *rsc, int *last_failure, pe_working_set_t *data_set); /* Binary like operators for lists of nodes */ -extern GListPtr node_list_exclude(GListPtr list1, GListPtr list2); +extern GListPtr node_list_exclude(GListPtr list1, GListPtr list2, gboolean merge_scores); extern GListPtr node_list_dup(GListPtr list1, gboolean reset, gboolean filter); extern GListPtr node_list_and(GListPtr list1, GListPtr list2, gboolean filter); extern GListPtr node_list_xor(GListPtr list1, GListPtr list2, gboolean filter); extern GListPtr node_list_minus(GListPtr list1,GListPtr list2,gboolean filter); extern gboolean node_list_eq(GListPtr list1, GListPtr list2, gboolean filter); extern GListPtr node_list_or(GListPtr list1, GListPtr list2, gboolean filter); extern void pe_free_shallow(GListPtr alist); extern void pe_free_shallow_adv(GListPtr alist, gboolean with_data); /* For creating the transition graph */ extern xmlNode *action2xml(action_t *action, gboolean as_input); /* Printing functions for debug */ extern void print_node( const char *pre_text, node_t *node, gboolean details); extern void print_resource( int log_level, const char *pre_text, resource_t *rsc, gboolean details); extern void dump_node_scores(int level, resource_t *rsc, const char *comment, GListPtr nodes); /* Sorting functions */ extern gint sort_rsc_priority(gconstpointer a, gconstpointer b); extern gint sort_rsc_index(gconstpointer a, gconstpointer b); extern xmlNode *find_rsc_op_entry(resource_t *rsc, const char *key); extern action_t *custom_action( resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set); #define delete_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DELETE, 0) #define delete_action(rsc, node, optional) custom_action( \ rsc, delete_key(rsc), CRMD_ACTION_DELETE, node, \ optional, TRUE, data_set); #define stopped_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOPPED, 0) #define stopped_action(rsc, node, optional) custom_action( \ rsc, stopped_key(rsc), CRMD_ACTION_STOPPED, node, \ optional, TRUE, data_set); #define stop_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOP, 0) #define stop_action(rsc, node, optional) custom_action( \ rsc, stop_key(rsc), CRMD_ACTION_STOP, node, \ optional, TRUE, data_set); #define start_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_START, 0) #define start_action(rsc, node, optional) custom_action( \ rsc, start_key(rsc), CRMD_ACTION_START, node, \ optional, TRUE, data_set) #define started_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STARTED, 0) #define started_action(rsc, node, optional) custom_action( \ rsc, started_key(rsc), CRMD_ACTION_STARTED, node, \ optional, TRUE, data_set) #define promote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTE, 0) #define promote_action(rsc, node, optional) custom_action( \ rsc, promote_key(rsc), CRMD_ACTION_PROMOTE, node, \ optional, TRUE, data_set) #define promoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTED, 0) #define promoted_action(rsc, node, optional) custom_action( \ rsc, promoted_key(rsc), CRMD_ACTION_PROMOTED, node, \ optional, TRUE, data_set) #define demote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTE, 0) #define demote_action(rsc, node, optional) custom_action( \ rsc, demote_key(rsc), CRMD_ACTION_DEMOTE, node, \ optional, TRUE, data_set) #define demoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTED, 0) #define demoted_action(rsc, node, optional) custom_action( \ rsc, demoted_key(rsc), CRMD_ACTION_DEMOTED, node, \ optional, TRUE, data_set) extern action_t *find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node); extern GListPtr find_actions(GListPtr input, const char *key, node_t *on_node); extern GListPtr find_actions_exact( GListPtr input, const char *key, node_t *on_node); extern GListPtr find_recurring_actions(GListPtr input, node_t *not_on_node); extern void set_id(xmlNode *xml_obj, const char *prefix, int child); extern void pe_free_action(action_t *action); extern void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set); extern gint sort_op_by_callid(gconstpointer a, gconstpointer b); extern gboolean get_target_role(resource_t *rsc, enum rsc_role_e *role); #endif diff --git a/pengine/clone.c b/pengine/clone.c index ce4f3e8c37..a33fe9ec3c 100644 --- a/pengine/clone.c +++ b/pengine/clone.c @@ -1,1731 +1,1731 @@ /* * Copyright (C) 2004 Andrew Beekhof * * 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 #include #include #include #include #define VARIANT_CLONE 1 #include gint sort_clone_instance(gconstpointer a, gconstpointer b, gpointer data_set); void child_stopping_constraints( clone_variant_data_t *clone_data, resource_t *self, resource_t *child, resource_t *last, pe_working_set_t *data_set); void child_starting_constraints( clone_variant_data_t *clone_data, resource_t *self, resource_t *child, resource_t *last, pe_working_set_t *data_set); static node_t * parent_node_instance(const resource_t *rsc, node_t *node) { node_t *ret = NULL; if(node != NULL) { ret = pe_find_node_id( rsc->parent->allowed_nodes, node->details->id); } return ret; } static gboolean did_fail(const resource_t *rsc) { if(is_set(rsc->flags, pe_rsc_failed)) { return TRUE; } slist_iter( child_rsc, resource_t, rsc->children, lpc, if(did_fail(child_rsc)) { return TRUE; } ); return FALSE; } gint sort_clone_instance(gconstpointer a, gconstpointer b, gpointer data_set) { int level = LOG_DEBUG_3; node_t *node1 = NULL; node_t *node2 = NULL; gboolean can1 = TRUE; gboolean can2 = TRUE; gboolean with_scores = TRUE; const resource_t *resource1 = (const resource_t*)a; const resource_t *resource2 = (const resource_t*)b; CRM_ASSERT(resource1 != NULL); CRM_ASSERT(resource2 != NULL); /* allocation order: * - active instances * - instances running on nodes with the least copies * - active instances on nodes that cant support them or are to be fenced * - failed instances * - inactive instances */ do_crm_log_unlikely(level+1, "%s ? %s", resource1->id, resource2->id); if(resource1->running_on && resource2->running_on) { if(g_list_length(resource1->running_on) < g_list_length(resource2->running_on)) { do_crm_log_unlikely(level, "%s < %s: running_on", resource1->id, resource2->id); return -1; } else if(g_list_length(resource1->running_on) > g_list_length(resource2->running_on)) { do_crm_log_unlikely(level, "%s > %s: running_on", resource1->id, resource2->id); return 1; } } if(resource1->running_on) { node1 = resource1->running_on->data; } if(resource2->running_on) { node2 = resource2->running_on->data; } if(node1) { node_t *match = pe_find_node_id(resource1->allowed_nodes, node1->details->id); if(match == NULL || match->weight < 0) { do_crm_log_unlikely(level, "%s: current location is unavailable", resource1->id); node1 = NULL; can1 = FALSE; } } if(node2) { node_t *match = pe_find_node_id(resource2->allowed_nodes, node2->details->id); if(match == NULL || match->weight < 0) { do_crm_log_unlikely(level, "%s: current location is unavailable", resource2->id); node2 = NULL; can2 = FALSE; } } if(can1 != can2) { if(can1) { do_crm_log_unlikely(level, "%s < %s: availability of current location", resource1->id, resource2->id); return -1; } do_crm_log_unlikely(level, "%s > %s: availability of current location", resource1->id, resource2->id); return 1; } if(resource1->priority < resource2->priority) { do_crm_log_unlikely(level, "%s < %s: priority", resource1->id, resource2->id); return 1; } else if(resource1->priority > resource2->priority) { do_crm_log_unlikely(level, "%s > %s: priority", resource1->id, resource2->id); return -1; } if(node1 == NULL && node2 == NULL) { do_crm_log_unlikely(level, "%s == %s: not active", resource1->id, resource2->id); return 0; } if(node1 != node2) { if(node1 == NULL) { do_crm_log_unlikely(level, "%s > %s: active", resource1->id, resource2->id); return 1; } else if(node2 == NULL) { do_crm_log_unlikely(level, "%s < %s: active", resource1->id, resource2->id); return -1; } } can1 = can_run_resources(node1); can2 = can_run_resources(node2); if(can1 != can2) { if(can1) { do_crm_log_unlikely(level, "%s < %s: can", resource1->id, resource2->id); return -1; } do_crm_log_unlikely(level, "%s > %s: can", resource1->id, resource2->id); return 1; } node1 = parent_node_instance(resource1, node1); node2 = parent_node_instance(resource2, node2); if(node1 != NULL && node2 == NULL) { do_crm_log_unlikely(level, "%s < %s: not allowed", resource1->id, resource2->id); return -1; } else if(node1 == NULL && node2 != NULL) { do_crm_log_unlikely(level, "%s > %s: not allowed", resource1->id, resource2->id); return 1; } if(node1 == NULL) { do_crm_log_unlikely(level, "%s == %s: not allowed", resource1->id, resource2->id); return 0; } if(node1->count < node2->count) { do_crm_log_unlikely(level, "%s < %s: count", resource1->id, resource2->id); return -1; } else if(node1->count > node2->count) { do_crm_log_unlikely(level, "%s > %s: count", resource1->id, resource2->id); return 1; } if(with_scores) { int max = 0; int lpc = 0; GListPtr list1 = node_list_dup(resource1->allowed_nodes, FALSE, FALSE); GListPtr list2 = node_list_dup(resource2->allowed_nodes, FALSE, FALSE); list1 = g_list_sort_with_data(list1, sort_node_weight, data_set); list2 = g_list_sort_with_data(list2, sort_node_weight, data_set); max = g_list_length(list1); if(max < g_list_length(list2)) { max = g_list_length(list2); } for(;lpc < max; lpc++) { node1 = g_list_nth_data(list1, lpc); node2 = g_list_nth_data(list2, lpc); if(node1 == NULL) { do_crm_log_unlikely(level, "%s < %s: node score NULL", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return 1; } else if(node2 == NULL) { do_crm_log_unlikely(level, "%s > %s: node score NULL", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return -1; } if(node1->weight < node2->weight) { do_crm_log_unlikely(level, "%s < %s: node score", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return 1; } else if(node1->weight > node2->weight) { do_crm_log_unlikely(level, "%s > %s: node score", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return -1; } } pe_free_shallow(list1); pe_free_shallow(list2); } can1 = did_fail(resource1); can2 = did_fail(resource2); if(can1 != can2) { if(can1) { do_crm_log_unlikely(level, "%s > %s: failed", resource1->id, resource2->id); return 1; } do_crm_log_unlikely(level, "%s < %s: failed", resource1->id, resource2->id); return -1; } if(node1 && node2) { int max = 0; int lpc = 0; GListPtr list1 = g_list_append(NULL, node_copy(resource1->running_on->data)); GListPtr list2 = g_list_append(NULL, node_copy(resource2->running_on->data)); /* Possibly a replacement for the with_scores block above */ slist_iter( constraint, rsc_colocation_t, resource1->parent->rsc_cons_lhs, lpc, do_crm_log_unlikely(level+1, "Applying %s to %s", constraint->id, resource1->id); list1 = native_merge_weights( constraint->rsc_lh, resource1->id, list1, constraint->node_attribute, constraint->score/INFINITY, FALSE); ); slist_iter( constraint, rsc_colocation_t, resource2->parent->rsc_cons_lhs, lpc, do_crm_log_unlikely(level+1, "Applying %s to %s", constraint->id, resource2->id); list2 = native_merge_weights( constraint->rsc_lh, resource2->id, list2, constraint->node_attribute, constraint->score/INFINITY, FALSE); ); list1 = g_list_sort_with_data(list1, sort_node_weight, data_set); list2 = g_list_sort_with_data(list2, sort_node_weight, data_set); max = g_list_length(list1); if(max < g_list_length(list2)) { max = g_list_length(list2); } for(;lpc < max; lpc++) { node1 = g_list_nth_data(list1, lpc); node2 = g_list_nth_data(list2, lpc); if(node1 == NULL) { do_crm_log_unlikely(level, "%s < %s: colocated score NULL", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return 1; } else if(node2 == NULL) { do_crm_log_unlikely(level, "%s > %s: colocated score NULL", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return -1; } if(node1->weight < node2->weight) { do_crm_log_unlikely(level, "%s < %s: colocated score", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return 1; } else if(node1->weight > node2->weight) { do_crm_log_unlikely(level, "%s > %s: colocated score", resource1->id, resource2->id); pe_free_shallow(list1); pe_free_shallow(list2); return -1; } } pe_free_shallow(list1); pe_free_shallow(list2); } do_crm_log_unlikely(level, "%s == %s: default %d", resource1->id, resource2->id, node2->weight); return 0; } static node_t * can_run_instance(resource_t *rsc, node_t *node) { node_t *local_node = NULL; clone_variant_data_t *clone_data = NULL; if(can_run_resources(node) == FALSE) { goto bail; } else if(is_set(rsc->flags, pe_rsc_orphan)) { goto bail; } local_node = parent_node_instance(rsc, node); get_clone_variant_data(clone_data, rsc->parent); if(local_node == NULL) { crm_warn("%s cannot run on %s: node not allowed", rsc->id, node->details->uname); goto bail; } else if(local_node->count < clone_data->clone_node_max) { return local_node; } else { crm_debug_2("%s cannot run on %s: node full", rsc->id, node->details->uname); } bail: if(node) { common_update_score(rsc, node->details->id, -INFINITY); } return NULL; } static node_t * color_instance(resource_t *rsc, pe_working_set_t *data_set) { node_t *chosen = NULL; node_t *local_node = NULL; crm_debug_2("Processing %s", rsc->id); if(is_not_set(rsc->flags, pe_rsc_provisional)) { return rsc->fns->location(rsc, NULL, FALSE); } else if(is_set(rsc->flags, pe_rsc_allocating)) { crm_debug("Dependency loop detected involving %s", rsc->id); return NULL; } if(rsc->allowed_nodes) { slist_iter(try_node, node_t, rsc->allowed_nodes, lpc, can_run_instance(rsc, try_node); ); } chosen = rsc->cmds->color(rsc, data_set); if(chosen) { local_node = pe_find_node_id( rsc->parent->allowed_nodes, chosen->details->id); if(local_node) { local_node->count++; } else if(is_set(rsc->flags, pe_rsc_managed)) { /* what to do? we can't enforce per-node limits in this case */ crm_config_err("%s not found in %s (list=%d)", chosen->details->id, rsc->parent->id, g_list_length(rsc->parent->allowed_nodes)); } } return chosen; } static void append_parent_colocation(resource_t *rsc, resource_t *child, gboolean all) { slist_iter(cons, rsc_colocation_t, rsc->rsc_cons, lpc, if(all || cons->score < 0 || cons->score == INFINITY) { child->rsc_cons = g_list_append(child->rsc_cons, cons); } ); slist_iter(cons, rsc_colocation_t, rsc->rsc_cons_lhs, lpc, if(all || cons->score < 0) { child->rsc_cons_lhs = g_list_append(child->rsc_cons_lhs, cons); } ); } node_t * clone_color(resource_t *rsc, pe_working_set_t *data_set) { int allocated = 0; int available_nodes = 0; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); if(is_not_set(rsc->flags, pe_rsc_provisional)) { return NULL; } else if(is_set(rsc->flags, pe_rsc_allocating)) { crm_debug("Dependency loop detected involving %s", rsc->id); return NULL; } set_bit(rsc->flags, pe_rsc_allocating); crm_debug_2("Processing %s", rsc->id); /* this information is used by sort_clone_instance() when deciding in which * order to allocate clone instances */ slist_iter( constraint, rsc_colocation_t, rsc->rsc_cons_lhs, lpc, 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(show_scores?0:scores_log_level, rsc, __FUNCTION__, rsc->allowed_nodes); /* count now tracks the number of clones currently allocated */ slist_iter(node, node_t, rsc->allowed_nodes, lpc, node->count = 0; ); slist_iter(child, resource_t, rsc->children, lpc, if(g_list_length(child->running_on) > 0) { node_t *child_node = child->running_on->data; node_t *local_node = parent_node_instance( child, child->running_on->data); if(local_node) { local_node->count++; } else { crm_err("%s is running on %s which isn't allowed", child->id, child_node->details->uname); } } ); rsc->children = g_list_sort_with_data(rsc->children, sort_clone_instance, data_set); /* count now tracks the number of clones we have allocated */ slist_iter(node, node_t, rsc->allowed_nodes, lpc, node->count = 0; ); rsc->allowed_nodes = g_list_sort_with_data( rsc->allowed_nodes, sort_node_weight, data_set); slist_iter(node, node_t, rsc->allowed_nodes, lpc, if(can_run_resources(node)) { available_nodes++; } ); slist_iter(child, resource_t, rsc->children, lpc, if(allocated >= clone_data->clone_max) { crm_debug("Child %s not allocated - limit reached", child->id); resource_location(child, NULL, -INFINITY, "clone_color:limit_reached", data_set); } else if (clone_data->clone_max < available_nodes) { /* Only include positive colocation preferences of dependant resources * if not every node will get a copy of the clone */ append_parent_colocation(rsc, child, TRUE); } else { append_parent_colocation(rsc, child, FALSE); } if(color_instance(child, data_set)) { allocated++; } ); crm_debug("Allocated %d %s instances of a possible %d", allocated, rsc->id, clone_data->clone_max); clear_bit(rsc->flags, pe_rsc_provisional); clear_bit(rsc->flags, pe_rsc_allocating); return NULL; } static void clone_update_pseudo_status( resource_t *rsc, gboolean *stopping, gboolean *starting, gboolean *active) { if(rsc->children) { slist_iter(child, resource_t, rsc->children, lpc, clone_update_pseudo_status(child, stopping, starting, active) ); return; } CRM_ASSERT(active != NULL); CRM_ASSERT(starting != NULL); CRM_ASSERT(stopping != NULL); if(rsc->running_on) { *active = TRUE; } slist_iter( action, action_t, rsc->actions, lpc, if(*starting && *stopping) { return; } else if(action->optional) { crm_debug_3("Skipping optional: %s", action->uuid); continue; } else if(action->pseudo == FALSE && action->runnable == FALSE){ crm_debug_3("Skipping unrunnable: %s", action->uuid); continue; } else if(safe_str_eq(RSC_STOP, action->task)) { crm_debug_2("Stopping due to: %s", action->uuid); *stopping = TRUE; } else if(safe_str_eq(RSC_START, action->task)) { if(action->runnable == FALSE) { crm_debug_3("Skipping pseudo-op: %s run=%d, pseudo=%d", action->uuid, action->runnable, action->pseudo); } else { crm_debug_2("Starting due to: %s", action->uuid); crm_debug_3("%s run=%d, pseudo=%d", action->uuid, action->runnable, action->pseudo); *starting = TRUE; } } ); } static action_t * find_rsc_action(resource_t *rsc, const char *key, gboolean active_only, GListPtr *list) { action_t *match = NULL; GListPtr possible = NULL; GListPtr active = NULL; possible = find_actions(rsc->actions, key, NULL); if(active_only) { slist_iter(op, action_t, possible, lpc, if(op->optional == FALSE) { active = g_list_append(active, op); } ); if(active && g_list_length(active) == 1) { match = g_list_nth_data(active, 0); } if(list) { *list = active; active = NULL; } } else if(possible && g_list_length(possible) == 1) { match = g_list_nth_data(possible, 0); } if(list) { *list = possible; possible = NULL; } if(possible) { g_list_free(possible); } if(active) { g_list_free(active); } return match; } static void child_ordering_constraints(resource_t *rsc, pe_working_set_t *data_set) { char *key = NULL; action_t *stop = NULL; action_t *start = NULL; action_t *last_stop = NULL; action_t *last_start = NULL; gboolean active_only = TRUE; /* change to false to get the old behavior */ clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); if(clone_data->ordered == FALSE) { return; } slist_iter( child, resource_t, rsc->children, lpc, key = stop_key(child); stop = find_rsc_action(child, key, active_only, NULL); crm_free(key); key = start_key(child); start = find_rsc_action(child, key, active_only, NULL); crm_free(key); if(stop) { if(last_stop) { /* child/child relative stop */ order_actions(stop, last_stop, pe_order_implies_left); } last_stop = stop; } if(start) { if(last_start) { /* child/child relative start */ order_actions(last_start, start, pe_order_implies_left); } last_start = start; } ); } void clone_create_actions(resource_t *rsc, pe_working_set_t *data_set) { gboolean child_active = FALSE; gboolean child_starting = FALSE; gboolean child_stopping = FALSE; action_t *stop = NULL; action_t *stopped = NULL; action_t *start = NULL; action_t *started = NULL; resource_t *last_start_rsc = NULL; resource_t *last_stop_rsc = NULL; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); crm_debug_2("Creating actions for %s", rsc->id); slist_iter( child_rsc, resource_t, rsc->children, lpc, child_rsc->cmds->create_actions(child_rsc, data_set); clone_update_pseudo_status( child_rsc, &child_stopping, &child_starting, &child_active); if(is_set(child_rsc->flags, pe_rsc_starting)) { last_start_rsc = child_rsc; } if(is_set(child_rsc->flags, pe_rsc_stopping)) { last_stop_rsc = child_rsc; } ); /* start */ start = start_action(rsc, NULL, !child_starting); started = custom_action(rsc, started_key(rsc), RSC_STARTED, NULL, !child_starting, TRUE, data_set); start->pseudo = TRUE; start->runnable = TRUE; started->pseudo = TRUE; started->priority = INFINITY; if(child_active || child_starting) { started->runnable = TRUE; } child_ordering_constraints(rsc, data_set); child_starting_constraints(clone_data, rsc, NULL, last_start_rsc, data_set); clone_data->start_notify = create_notification_boundaries(rsc, RSC_START, start, started, data_set); /* stop */ stop = stop_action(rsc, NULL, !child_stopping); stopped = custom_action(rsc, stopped_key(rsc), RSC_STOPPED, NULL, !child_stopping, TRUE, data_set); stop->pseudo = TRUE; stop->runnable = TRUE; stopped->pseudo = TRUE; stopped->runnable = TRUE; stopped->priority = INFINITY; child_stopping_constraints(clone_data, rsc, NULL, last_stop_rsc, data_set); clone_data->stop_notify = create_notification_boundaries(rsc, RSC_STOP, stop, stopped, data_set); if(clone_data->stop_notify && clone_data->start_notify) { order_actions(clone_data->stop_notify->post_done, clone_data->start_notify->pre, pe_order_optional); } } void child_starting_constraints( clone_variant_data_t *clone_data, resource_t *rsc, resource_t *child, resource_t *last, pe_working_set_t *data_set) { if(child == NULL && last == NULL) { crm_debug("%s has no active children", rsc->id); return; } if(child != NULL) { order_start_start( rsc, child, pe_order_runnable_left|pe_order_implies_left_printed); new_rsc_order(child, RSC_START, rsc, RSC_STARTED, pe_order_implies_right_printed, data_set); } if(FALSE && clone_data->ordered) { if(child == NULL) { /* last child start before global started */ new_rsc_order(last, RSC_START, rsc, RSC_STARTED, pe_order_runnable_left, data_set); } else if(last == NULL) { /* global start before first child start */ order_start_start( rsc, child, pe_order_implies_left); } else { /* child/child relative start */ order_start_start(last, child, pe_order_implies_left); } } } void child_stopping_constraints( clone_variant_data_t *clone_data, resource_t *rsc, resource_t *child, resource_t *last, pe_working_set_t *data_set) { if(child == NULL && last == NULL) { crm_debug("%s has no active children", rsc->id); return; } if(child != NULL) { order_stop_stop(rsc, child, pe_order_shutdown|pe_order_implies_left_printed); new_rsc_order(child, RSC_STOP, rsc, RSC_STOPPED, pe_order_implies_right_printed, data_set); } if(FALSE && clone_data->ordered) { if(last == NULL) { /* first child stop before global stopped */ new_rsc_order(child, RSC_STOP, rsc, RSC_STOPPED, pe_order_runnable_left, data_set); } else if(child == NULL) { /* global stop before last child stop */ order_stop_stop( rsc, last, pe_order_implies_left); } else { /* child/child relative stop */ order_stop_stop(child, last, pe_order_implies_left); } } } void clone_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); native_internal_constraints(rsc, data_set); /* global stop before stopped */ new_rsc_order(rsc, RSC_STOP, rsc, RSC_STOPPED, pe_order_runnable_left, data_set); /* global start before started */ new_rsc_order(rsc, RSC_START, rsc, RSC_STARTED, pe_order_runnable_left, data_set); /* global stopped before start */ new_rsc_order(rsc, RSC_STOPPED, rsc, RSC_START, pe_order_optional, data_set); slist_iter( child_rsc, resource_t, rsc->children, lpc, child_rsc->cmds->internal_constraints(child_rsc, data_set); child_starting_constraints( clone_data, rsc, child_rsc, last_rsc, data_set); child_stopping_constraints( clone_data, rsc, child_rsc, last_rsc, data_set); last_rsc = child_rsc; ); } resource_t* find_compatible_child( resource_t *local_child, resource_t *rsc, enum rsc_role_e filter, gboolean current) { node_t *local_node = NULL; node_t *node = NULL; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); local_node = local_child->fns->location(local_child, NULL, current); if(local_node == NULL) { crm_debug("Can't colocate unrunnable child %s with %s", local_child->id, rsc->id); return NULL; } slist_iter( child_rsc, resource_t, rsc->children, lpc, enum rsc_role_e next_role = child_rsc->fns->state(child_rsc, current); node = child_rsc->fns->location(child_rsc, NULL, current); if(filter != RSC_ROLE_UNKNOWN && next_role != filter) { crm_debug_2("Filtered %s", child_rsc->id); continue; } if(node && local_node && node->details == local_node->details) { crm_info("Colocating %s with %s on %s", local_child->id, child_rsc->id, node->details->uname); return child_rsc; } ); crm_debug("Can't colocate child %s with %s", local_child->id, rsc->id); return NULL; } void clone_rsc_colocation_lh( resource_t *rsc_lh, resource_t *rsc_rh, rsc_colocation_t *constraint) { gboolean do_interleave = FALSE; resource_t *rsc = constraint->rsc_lh; clone_variant_data_t *clone_data = NULL; clone_variant_data_t *clone_data_rh = NULL; if(rsc == NULL) { pe_err("rsc_lh was NULL for %s", constraint->id); return; } else if(constraint->rsc_rh == NULL) { pe_err("rsc_rh was NULL for %s", constraint->id); return; } else { crm_debug_4("Processing constraints from %s", rsc->id); } get_clone_variant_data(clone_data, rsc); if(constraint->rsc_rh->variant == pe_clone || constraint->rsc_rh->variant == pe_master) { get_clone_variant_data( clone_data_rh, constraint->rsc_rh); if(clone_data->clone_node_max != clone_data_rh->clone_node_max) { crm_config_err("Cannot interleave "XML_CIB_TAG_INCARNATION " %s and %s because" " they do not support the same number of" " resources per node", constraint->rsc_lh->id, constraint->rsc_rh->id); /* only the LHS side needs to be labeled as interleave */ } else if(clone_data->interleave) { do_interleave = TRUE; } else if(constraint->score >= INFINITY) { 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); if(chosen != NULL) { rhs = g_list_append(rhs, chosen); } ); - rsc_lh->allowed_nodes = node_list_exclude(lhs, rhs); + rsc_lh->allowed_nodes = node_list_exclude(lhs, rhs, TRUE); pe_free_shallow_adv(rhs, FALSE); pe_free_shallow(lhs); return; } } else if(constraint->score >= INFINITY) { crm_config_err("Manditory co-location of clones (%s) with other" " non-clone (%s) resources is not supported", rsc_lh->id, rsc_rh->id); return; } if(do_interleave) { resource_t *rh_child = NULL; slist_iter(lh_child, resource_t, rsc->children, lpc, CRM_ASSERT(lh_child != NULL); rh_child = find_compatible_child( lh_child, rsc_rh, RSC_ROLE_UNKNOWN, FALSE); if(rh_child == NULL) { crm_debug_2("No match found for %s", lh_child->id); continue; } crm_debug("Interleaving %s with %s", lh_child->id, rh_child->id); lh_child->cmds->rsc_colocation_lh( lh_child, rh_child, constraint); ); return; } slist_iter( child_rsc, resource_t, rsc->children, lpc, child_rsc->cmds->rsc_colocation_lh(child_rsc, constraint->rsc_rh, constraint); ); } void clone_rsc_colocation_rh( resource_t *rsc_lh, resource_t *rsc_rh, rsc_colocation_t *constraint) { clone_variant_data_t *clone_data = NULL; CRM_CHECK(rsc_lh != NULL, return); CRM_CHECK(rsc_lh->variant == pe_native, return); get_clone_variant_data(clone_data, rsc_rh); - crm_debug_3("Processing constraint %s: %d", constraint->id, constraint->score); + crm_debug_3("Processing constraint %s: %s -> %s %d", constraint->id, rsc_lh->id, rsc_rh->id, constraint->score); if(rsc_rh == NULL) { pe_err("rsc_rh was NULL for %s", constraint->id); return; } else if(is_set(rsc_rh->flags, pe_rsc_provisional)) { crm_debug_3("%s is still provisional", rsc_rh->id); return; } else if(constraint->score >= INFINITY) { 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); if(chosen != NULL) { rhs = g_list_append(rhs, chosen); } ); - rsc_lh->allowed_nodes = node_list_exclude(lhs, rhs); + rsc_lh->allowed_nodes = node_list_exclude(lhs, rhs, FALSE); pe_free_shallow_adv(rhs, FALSE); pe_free_shallow(lhs); return; } slist_iter( child_rsc, resource_t, rsc_rh->children, lpc, child_rsc->cmds->rsc_colocation_rh(rsc_lh, child_rsc, constraint); ); } /* Clone <-> Clone ordering S : Start(ed) S' : Stop(ped) P : Promote(d) D : Demote(d) Started == Demoted First A then B A:0 B:0 Old New Old New S' S' S S' S' S' S' - S' S S S+ S' S S' S S S' S S' S S' S' - S S S - S S S' S S' S' P S' S' S' S' - S' P P P+ S' P S' P P S' P S' P S' S' - P P P - P P S' P D D P D D D D - D P P P+ D P D P P D P D P D D - P P P - P P D P Clone <-> Primitive ordering S : Start(ed) S' : Stop(ped) P : Promote(d) D : Demote(d) F : False T : True F' : A good idea? Started == Demoted First A then B A:0 B Old New Old Create Constraint S' S' S F S' S' S' F' S S' S T S S' S' F S' S S T S' S S' T S S S F' S S S' T S' S' S F S' S' S' F' P S' S T P S' S' F S' P S T S' P S' T P P S F' P P S' F S' S' S F S' S' S' F' D S' S T D S' S' F S' D S T S' D S' T D D S F' D D S' T */ static gboolean detect_restart(resource_t *rsc) { gboolean restart = FALSE; /* Look for restarts */ action_t *start = NULL; char *key = start_key(rsc); GListPtr possible_matches = find_actions(rsc->actions, key, NULL); crm_free(key); if(possible_matches) { start = possible_matches->data; g_list_free(possible_matches); } if(start != NULL && start->optional == FALSE) { restart = TRUE; crm_debug_2("Detected a restart for %s", rsc->id); } /* Otherwise, look for moves */ if(restart == FALSE) { GListPtr old_hosts = NULL; GListPtr new_hosts = NULL; GListPtr intersection = NULL; rsc->fns->location(rsc, &old_hosts, TRUE); rsc->fns->location(rsc, &new_hosts, FALSE); intersection = node_list_and(old_hosts, new_hosts, FALSE); if(intersection == NULL) { restart = TRUE; /* Actually a move but the result is the same */ crm_debug_2("Detected a move for %s", rsc->id); } g_list_free(intersection); g_list_free(old_hosts); g_list_free(new_hosts); } return restart; } static void clone_rsc_order_lh_non_clone(resource_t *rsc, order_constraint_t *order, pe_working_set_t *data_set) { GListPtr hosts = NULL; GListPtr rh_hosts = NULL; GListPtr intersection = NULL; const char *reason = "unknown"; enum action_tasks task = start_rsc; enum rsc_role_e lh_role = RSC_ROLE_STARTED; int any_ordered = 0; gboolean down_stack = TRUE; crm_debug_2("Clone-to-* ordering: %s -> %s 0x%.6x", order->lh_action_task, order->rh_action_task, order->type); if(strstr(order->rh_action_task, "_"RSC_STOP"_0") || strstr(order->rh_action_task, "_"RSC_STOPPED"_0")) { task = stop_rsc; reason = "down activity"; lh_role = RSC_ROLE_STOPPED; order->rh_rsc->fns->location(order->rh_rsc, &rh_hosts, down_stack); } else if(strstr(order->rh_action_task, "_"RSC_DEMOTE"_0") || strstr(order->rh_action_task, "_"RSC_DEMOTED"_0")) { task = action_demote; reason = "demotion activity"; lh_role = RSC_ROLE_SLAVE; order->rh_rsc->fns->location(order->rh_rsc, &rh_hosts, down_stack); } else if(strstr(order->lh_action_task, "_"RSC_PROMOTE"_0") || strstr(order->lh_action_task, "_"RSC_PROMOTED"_0")) { task = action_promote; down_stack = FALSE; reason = "promote activity"; order->rh_rsc->fns->location(order->rh_rsc, &rh_hosts, down_stack); lh_role = RSC_ROLE_MASTER; } else if(strstr(order->rh_action_task, "_"RSC_START"_0") || strstr(order->rh_action_task, "_"RSC_STARTED"_0")) { task = start_rsc; down_stack = FALSE; reason = "up activity"; order->rh_rsc->fns->location(order->rh_rsc, &rh_hosts, down_stack); /* if(order->rh_rsc->variant > pe_clone) { */ /* lh_role = RSC_ROLE_SLAVE; */ /* } */ } else { crm_err("Unknown task: %s", order->rh_action_task); return; } /* slist_iter(h, node_t, rh_hosts, llpc, crm_info("RHH: %s", h->details->uname)); */ slist_iter( child_rsc, resource_t, rsc->children, lpc, gboolean create = FALSE; gboolean restart = FALSE; enum rsc_role_e lh_role_new = child_rsc->fns->state(child_rsc, FALSE); enum rsc_role_e lh_role_old = child_rsc->fns->state(child_rsc, TRUE); enum rsc_role_e child_role = child_rsc->fns->state(child_rsc, down_stack); crm_debug_4("Testing %s->%s for %s: %s vs. %s %s", order->lh_action_task, order->rh_action_task, child_rsc->id, role2text(lh_role), role2text(child_role), order->lh_action_task); if(rh_hosts == NULL) { crm_debug_3("Terminating search: %s.%d list is empty: no possible %s", order->rh_rsc->id, down_stack, reason); break; } if(lh_role_new == lh_role_old) { restart = detect_restart(child_rsc); if(restart == FALSE) { crm_debug_3("Ignoring %s->%s for %s: no relevant %s (no role change)", order->lh_action_task, order->rh_action_task, child_rsc->id, reason); continue; } } hosts = NULL; child_rsc->fns->location(child_rsc, &hosts, down_stack); intersection = node_list_and(hosts, rh_hosts, FALSE); /* slist_iter(h, node_t, hosts, llpc, crm_info("H: %s %s", child_rsc->id, h->details->uname)); */ if(intersection == NULL) { crm_debug_3("Ignoring %s->%s for %s: no relevant %s", order->lh_action_task, order->rh_action_task, child_rsc->id, reason); g_list_free(hosts); continue; } if(restart) { reason = "restart"; create = TRUE; } else if(down_stack) { if(lh_role_old > lh_role) { create = TRUE; } } else if(down_stack == FALSE) { if(lh_role_old < lh_role) { create = TRUE; } } else { any_ordered++; reason = "role"; crm_debug_4("Role: %s->%s for %s: %s vs. %s %s", order->lh_action_task, order->rh_action_task, child_rsc->id, role2text(lh_role_old), role2text(lh_role), order->lh_action_task); } if(create) { char *task = order->lh_action_task; any_ordered++; crm_debug("Enforcing %s->%s for %s on %s: found %s", order->lh_action_task, order->rh_action_task, child_rsc->id, ((node_t*)intersection->data)->details->uname, reason); order->lh_action_task = convert_non_atomic_task(task, child_rsc, TRUE, FALSE); child_rsc->cmds->rsc_order_lh(child_rsc, order, data_set); crm_free(order->lh_action_task); order->lh_action_task = task; } crm_debug_3("Processed %s->%s for %s on %s: %s", order->lh_action_task, order->rh_action_task, child_rsc->id, ((node_t*)intersection->data)->details->uname, reason); /* slist_iter(h, node_t, hosts, llpc, */ /* crm_info("H: %s %s", child_rsc->id, h->details->uname)); */ g_list_free(intersection); g_list_free(hosts); ); g_list_free(rh_hosts); if(any_ordered == 0 && down_stack == FALSE) { GListPtr lh_hosts = NULL; if(order->type & pe_order_runnable_left) { rsc->fns->location(rsc, &lh_hosts, FALSE); } if(lh_hosts == NULL) { order->lh_action_task = convert_non_atomic_task(order->lh_action_task, rsc, TRUE, TRUE); native_rsc_order_lh(rsc, order, data_set); } g_list_free(lh_hosts); } order->type = pe_order_optional; } void clone_rsc_order_lh(resource_t *rsc, order_constraint_t *order, pe_working_set_t *data_set) { resource_t *r1 = NULL; resource_t *r2 = NULL; gboolean do_interleave = FALSE; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); crm_debug_4("%s->%s", order->lh_action_task, order->rh_action_task); if(order->rh_rsc == NULL) { order->lh_action_task = convert_non_atomic_task(order->lh_action_task, rsc, FALSE, TRUE); native_rsc_order_lh(rsc, order, data_set); return; } r1 = uber_parent(rsc); r2 = uber_parent(order->rh_rsc); if(r1 == r2) { native_rsc_order_lh(rsc, order, data_set); return; } if(order->rh_rsc->variant > pe_group) { clone_variant_data_t *clone_data_rh = NULL; get_clone_variant_data(clone_data_rh, order->rh_rsc); if(clone_data->clone_node_max != clone_data_rh->clone_node_max) { crm_config_err("Cannot interleave "XML_CIB_TAG_INCARNATION " %s and %s because they do not support the same" " number of resources per node", rsc->id, order->rh_rsc->id); /* only the LHS side needs to be labeled as interleave */ } else if(clone_data->interleave) { do_interleave = TRUE; } } if(order->rh_rsc == NULL) { do_interleave = FALSE; } if(do_interleave) { resource_t *lh_child = NULL; resource_t *rh_saved = order->rh_rsc; gboolean current = FALSE; if(strstr(order->lh_action_task, "_stop_0") || strstr(order->lh_action_task, "_demote_0")) { current = TRUE; } slist_iter( rh_child, resource_t, rh_saved->children, lpc, CRM_ASSERT(rh_child != NULL); lh_child = find_compatible_child(rh_child, rsc, RSC_ROLE_UNKNOWN, current); if(lh_child == NULL) { crm_debug_2("No match found for %s", rh_child->id); continue; } crm_notice("Interleaving %s with %s", lh_child->id, rh_child->id); order->rh_rsc = rh_child; lh_child->cmds->rsc_order_lh(lh_child, order, data_set); order->rh_rsc = rh_saved; ); } else { #if 0 if(order->type != pe_order_optional) { crm_debug("Upgraded ordering constraint %d - 0x%.6x", order->id, order->type); native_rsc_order_lh(rsc, order, data_set); } #endif if(order->rh_rsc->variant < pe_clone) { clone_rsc_order_lh_non_clone(rsc, order, data_set); } else if(order->type & pe_order_implies_left) { if(rsc->variant == order->rh_rsc->variant) { crm_debug_2("Clone-to-clone ordering: %s -> %s 0x%.6x", order->lh_action_task, order->rh_action_task, order->type); /* stop instances on the same nodes as stopping RHS instances */ slist_iter( child_rsc, resource_t, rsc->children, lpc, native_rsc_order_lh(child_rsc, order, data_set); ); } else { /* stop everything */ slist_iter( child_rsc, resource_t, rsc->children, lpc, native_rsc_order_lh(child_rsc, order, data_set); ); } } } if(do_interleave == FALSE || clone_data->ordered) { order->lh_action_task = convert_non_atomic_task(order->lh_action_task, rsc, FALSE, TRUE); native_rsc_order_lh(rsc, order, data_set); } if(is_set(rsc->flags, pe_rsc_notify)) { order->type = pe_order_optional; order->lh_action_task = convert_non_atomic_task(order->lh_action_task, rsc, TRUE, TRUE); native_rsc_order_lh(rsc, order, data_set); } } static void clone_rsc_order_rh_non_clone( resource_t *lh_p, action_t *lh_action, resource_t *rsc, order_constraint_t *order) { GListPtr hosts = NULL; GListPtr lh_hosts = NULL; GListPtr intersection = NULL; const char *reason = "unknown"; gboolean restart = FALSE; gboolean down_stack = TRUE; enum rsc_role_e rh_role = RSC_ROLE_STARTED; enum action_tasks task = start_rsc; enum rsc_role_e lh_role_new = lh_p->fns->state(lh_p, FALSE); enum rsc_role_e lh_role_old = lh_p->fns->state(lh_p, TRUE); /* Make sure the pre-req will be active */ if(order->type & pe_order_runnable_left) { lh_p->fns->location(lh_p, &lh_hosts, FALSE); if(lh_hosts == NULL) { crm_debug("Terminating search: Pre-requisite %s of %s is unrunnable", lh_p->id, rsc->id); native_rsc_order_rh(lh_action, rsc, order); return; } g_list_free(lh_hosts); lh_hosts = NULL; } if(strstr(order->lh_action_task, "_"RSC_STOP"_0") || strstr(order->lh_action_task, "_"RSC_STOPPED"_0")) { task = stop_rsc; reason = "down activity"; rh_role = RSC_ROLE_STOPPED; lh_p->fns->location(lh_p, &lh_hosts, down_stack); /* These actions are not possible for non-clones } else if(strstr(order->lh_action_task, "_"RSC_DEMOTE"_0") || strstr(order->lh_action_task, "_"RSC_DEMOTED"_0")) { task = action_demote; rh_role = RSC_ROLE_SLAVE; reason = "demotion activity"; lh_p->fns->location(lh_p, &lh_hosts, down_stack); } else if(strstr(order->lh_action_task, "_"RSC_PROMOTE"_0") || strstr(order->lh_action_task, "_"RSC_PROMOTED"_0")) { task = action_promote; down_stack = FALSE; reason = "promote activity"; lh_p->fns->location(lh_p, &lh_hosts, down_stack); rh_role = RSC_ROLE_MASTER; */ } else if(strstr(order->lh_action_task, "_"RSC_START"_0") || strstr(order->lh_action_task, "_"RSC_STARTED"_0")) { task = start_rsc; down_stack = FALSE; reason = "up activity"; lh_p->fns->location(lh_p, &lh_hosts, down_stack); } else { crm_err("Unknown action: %s", order->lh_action_task); return; } if(lh_role_new == lh_role_old) { restart = detect_restart(lh_action->rsc); if(FALSE && restart == FALSE) { crm_debug_3("Ignoring %s->%s for %s: no relevant %s (no role change)", lh_action->task, order->lh_action_task, lh_p->id, reason); goto cleanup; } } /* slist_iter(h, node_t, lh_hosts, llpc, crm_info("LHH: %s", h->details->uname)); */ slist_iter( child_rsc, resource_t, rsc->children, lpc, gboolean create = FALSE; enum rsc_role_e child_role = child_rsc->fns->state(child_rsc, down_stack); crm_debug_4("Testing %s->%s for %s: %s vs. %s %s", lh_action->task, order->lh_action_task, child_rsc->id, role2text(rh_role), role2text(child_role), order->lh_action_task); if(lh_hosts == NULL) { crm_debug_3("Terminating search: %s.%d list is empty: no possible %s", order->rh_rsc->id, down_stack, reason); break; } hosts = NULL; child_rsc->fns->location(child_rsc, &hosts, down_stack); intersection = node_list_and(hosts, lh_hosts, FALSE); if(intersection == NULL) { crm_debug_3("Ignoring %s->%s for %s: no relevant %s", lh_action->task, order->lh_action_task, child_rsc->id, reason); g_list_free(hosts); continue; } /* slist_iter(h, node_t, hosts, llpc, crm_info("H: %s %s", child_rsc->id, h->details->uname)); */ if(restart) { reason = "restart"; create = TRUE; } else if(down_stack && lh_role_old >= rh_role) { create = TRUE; } else if(down_stack == FALSE && lh_role_old <= rh_role) { create = TRUE; } else { reason = "role"; } if(create) { enum pe_ordering type = order->type; child_rsc->cmds->rsc_order_rh(lh_action, child_rsc, order); order->type = pe_order_optional; native_rsc_order_rh(lh_action, rsc, order); order->type = type; } crm_debug_3("Processed %s->%s for %s on %s: found %s%s", lh_action->task, order->lh_action_task, child_rsc->id, ((node_t*)intersection->data)->details->uname, reason, create?" - enforced":""); /* slist_iter(h, node_t, hosts, llpc, */ /* crm_info("H: %s %s", child_rsc->id, h->details->uname)); */ g_list_free(intersection); g_list_free(hosts); ); cleanup: g_list_free(lh_hosts); } void clone_rsc_order_rh( action_t *lh_action, resource_t *rsc, order_constraint_t *order) { enum pe_ordering type = order->type; clone_variant_data_t *clone_data = NULL; resource_t *lh_p = uber_parent(lh_action->rsc); get_clone_variant_data(clone_data, rsc); crm_debug_2("%s->%s", order->lh_action_task, order->rh_action_task); if(safe_str_eq(CRM_OP_PROBED, lh_action->uuid)) { slist_iter( child_rsc, resource_t, rsc->children, lpc, child_rsc->cmds->rsc_order_rh(lh_action, child_rsc, order); ); if(rsc->fns->state(rsc, TRUE) < RSC_ROLE_STARTED && rsc->fns->state(rsc, FALSE) > RSC_ROLE_STOPPED) { order->type |= pe_order_implies_right; } } else if(lh_p && lh_p != rsc && lh_p->variant < pe_clone) { clone_rsc_order_rh_non_clone(lh_p, lh_action, rsc, order); return; } native_rsc_order_rh(lh_action, rsc, order); order->type = type; } void clone_rsc_location(resource_t *rsc, rsc_to_node_t *constraint) { clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); crm_debug_3("Processing location constraint %s for %s", constraint->id, rsc->id); native_rsc_location(rsc, constraint); slist_iter( child_rsc, resource_t, rsc->children, lpc, child_rsc->cmds->rsc_location(child_rsc, constraint); ); } void clone_expand(resource_t *rsc, pe_working_set_t *data_set) { clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); crm_debug_2("Processing actions from %s", rsc->id); if(clone_data->start_notify) { collect_notification_data(rsc, TRUE, TRUE, clone_data->start_notify); expand_notification_data(clone_data->start_notify); create_notifications(rsc, clone_data->start_notify, data_set); } if(clone_data->stop_notify) { collect_notification_data(rsc, TRUE, TRUE, clone_data->stop_notify); expand_notification_data(clone_data->stop_notify); create_notifications(rsc, clone_data->stop_notify, data_set); } if(clone_data->promote_notify) { collect_notification_data(rsc, TRUE, TRUE, clone_data->promote_notify); expand_notification_data(clone_data->promote_notify); create_notifications(rsc, clone_data->promote_notify, data_set); } if(clone_data->demote_notify) { collect_notification_data(rsc, TRUE, TRUE, clone_data->demote_notify); expand_notification_data(clone_data->demote_notify); create_notifications(rsc, clone_data->demote_notify, data_set); } /* Now that the notifcations have been created we can expand the children */ slist_iter( child_rsc, resource_t, rsc->children, lpc, child_rsc->cmds->expand(child_rsc, data_set)); native_expand(rsc, data_set); /* The notifications are in the graph now, we can destroy the notify_data */ free_notification_data(clone_data->demote_notify); free_notification_data(clone_data->stop_notify); free_notification_data(clone_data->start_notify); free_notification_data(clone_data->promote_notify); } static gint sort_rsc_id(gconstpointer a, gconstpointer b) { const resource_t *resource1 = (const resource_t*)a; const resource_t *resource2 = (const resource_t*)b; CRM_ASSERT(resource1 != NULL); CRM_ASSERT(resource2 != NULL); return strcmp(resource1->id, resource2->id); } static resource_t *find_instance_on(resource_t *rsc, node_t *node) { slist_iter(child, resource_t, rsc->children, lpc, GListPtr known_list = NULL; rsc_known_on(child, &known_list); slist_iter(known, node_t, known_list, lpc2, if(node->details == known->details) { g_list_free(known_list); return child; } ); g_list_free(known_list); ); return NULL; } gboolean clone_create_probe(resource_t *rsc, node_t *node, action_t *complete, gboolean force, pe_working_set_t *data_set) { gboolean any_created = FALSE; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); rsc->children = g_list_sort(rsc->children, sort_rsc_id); if(rsc->children == NULL) { pe_warn("Clone %s has no children", rsc->id); return FALSE; } if(is_not_set(rsc->flags, pe_rsc_unique) && clone_data->clone_node_max == 1) { /* only look for one copy */ resource_t *child = NULL; /* Try whoever we probed last time */ child = find_instance_on(rsc, node); if(child) { return child->cmds->create_probe( child, node, complete, force, data_set); } /* Try whoever we plan on starting there */ slist_iter( child_rsc, resource_t, rsc->children, lpc, node_t *local_node = child_rsc->fns->location(child_rsc, NULL, FALSE); if(local_node == NULL) { continue; } if(local_node->details == node->details) { return child_rsc->cmds->create_probe( child_rsc, node, complete, force, data_set); } ); /* Fall back to the first clone instance */ child = rsc->children->data; return child->cmds->create_probe(child, node, complete, force, data_set); } slist_iter( child_rsc, resource_t, rsc->children, lpc, if(child_rsc->cmds->create_probe( child_rsc, node, complete, force, data_set)) { any_created = TRUE; } if(any_created && is_not_set(rsc->flags, pe_rsc_unique) && clone_data->clone_node_max == 1) { /* only look for one copy (clone :0) */ break; } ); return any_created; } void clone_append_meta(resource_t *rsc, xmlNode *xml) { char *name = NULL; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); name = crm_meta_name(XML_RSC_ATTR_UNIQUE); crm_xml_add(xml, name, is_set(rsc->flags, pe_rsc_unique)?"true":"false"); crm_free(name); name = crm_meta_name(XML_RSC_ATTR_NOTIFY); crm_xml_add(xml, name, is_set(rsc->flags, pe_rsc_notify)?"true":"false"); crm_free(name); name = crm_meta_name(XML_RSC_ATTR_INCARNATION_MAX); crm_xml_add_int(xml, name, clone_data->clone_max); crm_free(name); name = crm_meta_name(XML_RSC_ATTR_INCARNATION_NODEMAX); crm_xml_add_int(xml, name, clone_data->clone_node_max); crm_free(name); } diff --git a/pengine/master.c b/pengine/master.c index 15aaf13ecf..c4987a168f 100644 --- a/pengine/master.c +++ b/pengine/master.c @@ -1,889 +1,889 @@ /* * Copyright (C) 2004 Andrew Beekhof * * 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 #include #include #include #include #define VARIANT_CLONE 1 #include extern gint sort_clone_instance(gconstpointer a, gconstpointer b, gpointer data_set); 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, gpointer data_set) { 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, data_set); } static void master_promotion_order(resource_t *rsc, pe_working_set_t *data_set) { 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, lpc, /* (re-)adds location preferences of resources that the * master instance should/must be colocated with */ if(constraint->role_lh == RSC_ROLE_MASTER) { crm_debug_2("RHS: %s with %s: %d", constraint->rsc_lh->id, constraint->rsc_rh->id, constraint->score); rsc->allowed_nodes = constraint->rsc_rh->cmds->merge_weights( constraint->rsc_rh, rsc->id, rsc->allowed_nodes, constraint->node_attribute, constraint->score/INFINITY, TRUE); } ); 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) { crm_debug_2("LHS: %s with %s: %d", constraint->rsc_lh->id, constraint->rsc_rh->id, constraint->score); 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_with_data(rsc->children, sort_master_instance, data_set); } 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) aapplied_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); 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_slave(resource_t *rsc, gboolean current) { if(current) { if(rsc->role == RSC_ROLE_STARTED) { rsc->role = RSC_ROLE_SLAVE; } } else { GListPtr allocated = NULL; rsc->fns->location(rsc, &allocated, FALSE); if(allocated) { rsc->next_role = RSC_ROLE_SLAVE; } else { rsc->next_role = RSC_ROLE_STOPPED; } g_list_free(allocated); } slist_iter( child_rsc, resource_t, rsc->children, lpc, set_role_slave(child_rsc, current); ); } static void set_role_master(resource_t *rsc) { if(rsc->next_role == RSC_ROLE_UNKNOWN) { rsc->next_role = RSC_ROLE_MASTER; } slist_iter( child_rsc, resource_t, rsc->children, lpc, set_role_master(child_rsc); ); } 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: %s", child_rsc->id, role2text(child_rsc->next_role)); if(child_rsc->fns->state(child_rsc, TRUE) == RSC_ROLE_STARTED) { set_role_slave(child_rsc, 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: case RSC_ROLE_UNKNOWN: 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: /* We will arrive here if we're re-creating actions after a stonith * OR target-role is set */ 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, data_set); /* 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) { set_role_slave(child_rsc, FALSE); continue; } chosen->count++; crm_info("Promoting %s (%s %s)", child_rsc->id, role2text(child_rsc->role), chosen->details->uname); set_role_master(child_rsc); promoted++; ); 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); + rsc_lh->allowed_nodes = node_list_exclude(lhs, rhs, TRUE); 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; } void master_append_meta(resource_t *rsc, xmlNode *xml) { char *name = NULL; clone_variant_data_t *clone_data = NULL; get_clone_variant_data(clone_data, rsc); clone_append_meta(rsc, xml); name = crm_meta_name(XML_RSC_ATTR_MASTER_MAX); crm_xml_add_int(xml, name, clone_data->master_max); crm_free(name); name = crm_meta_name(XML_RSC_ATTR_MASTER_NODEMAX); crm_xml_add_int(xml, name, clone_data->master_node_max); crm_free(name); } diff --git a/pengine/test10/bug-lf-2153.scores b/pengine/test10/bug-lf-2153.scores index 3979aff148..903e74f39d 100644 --- a/pengine/test10/bug-lf-2153.scores +++ b/pengine/test10/bug-lf-2153.scores @@ -1,55 +1,55 @@ Allocation scores: clone_color: ms_drbd_iscsivg01 allocation score on alice: 1500 clone_color: ms_drbd_iscsivg01 allocation score on bob: -1000000 clone_color: res_drbd_iscsivg01:0 allocation score on alice: 0 clone_color: res_drbd_iscsivg01:0 allocation score on bob: 1 clone_color: res_drbd_iscsivg01:1 allocation score on alice: 101 clone_color: res_drbd_iscsivg01:1 allocation score on bob: 0 native_color: res_drbd_iscsivg01:1 allocation score on alice: 101 native_color: res_drbd_iscsivg01:1 allocation score on bob: -1000000 native_color: res_drbd_iscsivg01:0 allocation score on alice: -1000000 native_color: res_drbd_iscsivg01:0 allocation score on bob: -1000000 res_drbd_iscsivg01:1 promotion score on alice: 3100 res_drbd_iscsivg01:0 promotion score on none: 0 clone_color: cl_tgtd allocation score on alice: 1500 clone_color: cl_tgtd allocation score on bob: -1000000 clone_color: res_tgtd:0 allocation score on alice: 0 clone_color: res_tgtd:0 allocation score on bob: 1 clone_color: res_tgtd:1 allocation score on alice: 1 clone_color: res_tgtd:1 allocation score on bob: 0 native_color: res_tgtd:1 allocation score on alice: 1 native_color: res_tgtd:1 allocation score on bob: -1000000 native_color: res_tgtd:0 allocation score on alice: -1000000 native_color: res_tgtd:0 allocation score on bob: -1000000 group_color: rg_iscsivg01 allocation score on alice: 100 group_color: rg_iscsivg01 allocation score on bob: 0 group_color: res_portblock_iscsivg01_block allocation score on alice: 300 group_color: res_portblock_iscsivg01_block allocation score on bob: 0 group_color: res_lvm_iscsivg01 allocation score on alice: 200 group_color: res_lvm_iscsivg01 allocation score on bob: 0 group_color: res_target_iscsivg01 allocation score on alice: 200 group_color: res_target_iscsivg01 allocation score on bob: 0 group_color: res_lu_iscsivg01_lun1 allocation score on alice: 200 group_color: res_lu_iscsivg01_lun1 allocation score on bob: 0 group_color: res_lu_iscsivg01_lun2 allocation score on alice: 200 group_color: res_lu_iscsivg01_lun2 allocation score on bob: 0 group_color: res_ip_alicebob01 allocation score on alice: 200 group_color: res_ip_alicebob01 allocation score on bob: 0 group_color: res_portblock_iscsivg01_unblock allocation score on alice: 200 group_color: res_portblock_iscsivg01_unblock allocation score on bob: 0 res_drbd_iscsivg01:1 promotion score on alice: 1000000 res_drbd_iscsivg01:0 promotion score on none: 0 -native_color: res_portblock_iscsivg01_block allocation score on alice: 1602 +native_color: res_portblock_iscsivg01_block allocation score on alice: 1601 native_color: res_portblock_iscsivg01_block allocation score on bob: -1000000 native_color: res_lvm_iscsivg01 allocation score on alice: 1200 native_color: res_lvm_iscsivg01 allocation score on bob: -1000000 native_color: res_target_iscsivg01 allocation score on alice: 1000 native_color: res_target_iscsivg01 allocation score on bob: -1000000 native_color: res_lu_iscsivg01_lun1 allocation score on alice: 800 native_color: res_lu_iscsivg01_lun1 allocation score on bob: -1000000 native_color: res_lu_iscsivg01_lun2 allocation score on alice: 600 native_color: res_lu_iscsivg01_lun2 allocation score on bob: -1000000 native_color: res_ip_alicebob01 allocation score on alice: 400 native_color: res_ip_alicebob01 allocation score on bob: -1000000 native_color: res_portblock_iscsivg01_unblock allocation score on alice: 200 native_color: res_portblock_iscsivg01_unblock allocation score on bob: -1000000 diff --git a/pengine/test10/bug-lf-2160.scores b/pengine/test10/bug-lf-2160.scores index 8e1365f9d7..75d81e67f3 100644 --- a/pengine/test10/bug-lf-2160.scores +++ b/pengine/test10/bug-lf-2160.scores @@ -1,19 +1,19 @@ Allocation scores: clone_color: clone-dom0-iscsi1 allocation score on dualamd3: 0 clone_color: clone-dom0-iscsi1 allocation score on dualamd1: 5000 clone_color: clone-dom0-iscsi1 allocation score on cardhu: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dualamd3: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dualamd1: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on cardhu: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dualamd3: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dualamd1: 1 clone_color: dom0-iscsi1-cnx1:1 allocation score on cardhu: 0 native_color: dom0-iscsi1-cnx1:1 allocation score on dualamd3: 0 native_color: dom0-iscsi1-cnx1:1 allocation score on dualamd1: 5001 native_color: dom0-iscsi1-cnx1:1 allocation score on cardhu: 0 native_color: dom0-iscsi1-cnx1:0 allocation score on dualamd3: 1 native_color: dom0-iscsi1-cnx1:0 allocation score on dualamd1: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on cardhu: 0 -native_color: domU-test01 allocation score on dualamd3: 1 -native_color: domU-test01 allocation score on dualamd1: 10001 +native_color: domU-test01 allocation score on dualamd3: 0 +native_color: domU-test01 allocation score on dualamd1: 5000 native_color: domU-test01 allocation score on cardhu: -1000000 diff --git a/pengine/test10/bug-n-387749.scores b/pengine/test10/bug-n-387749.scores index ee2fdc1bff..60d54c2a3f 100644 --- a/pengine/test10/bug-n-387749.scores +++ b/pengine/test10/bug-n-387749.scores @@ -1,37 +1,37 @@ Allocation scores: clone_color: export_home_ocfs2_clone_set allocation score on power720-1: 1000000 clone_color: export_home_ocfs2_clone_set allocation score on power720-2: 2000 clone_color: export_home_ocfs2_clone_set allocation score on power720-4: -1000000 clone_color: export_home_ocfs2:0 allocation score on power720-1: 0 clone_color: export_home_ocfs2:0 allocation score on power720-2: 0 clone_color: export_home_ocfs2:0 allocation score on power720-4: 0 clone_color: export_home_ocfs2:1 allocation score on power720-1: 0 clone_color: export_home_ocfs2:1 allocation score on power720-2: 1 clone_color: export_home_ocfs2:1 allocation score on power720-4: 0 clone_color: export_home_ocfs2:2 allocation score on power720-1: 0 clone_color: export_home_ocfs2:2 allocation score on power720-2: 0 clone_color: export_home_ocfs2:2 allocation score on power720-4: 0 native_color: export_home_ocfs2:1 allocation score on power720-1: 0 native_color: export_home_ocfs2:1 allocation score on power720-2: 1 native_color: export_home_ocfs2:1 allocation score on power720-4: -1000000 native_color: export_home_ocfs2:0 allocation score on power720-1: 0 native_color: export_home_ocfs2:0 allocation score on power720-2: -1000000 native_color: export_home_ocfs2:0 allocation score on power720-4: -1000000 native_color: export_home_ocfs2:2 allocation score on power720-1: -1000000 native_color: export_home_ocfs2:2 allocation score on power720-2: -1000000 native_color: export_home_ocfs2:2 allocation score on power720-4: -1000000 group_color: group_nfs allocation score on power720-1: 1000000 group_color: group_nfs allocation score on power720-2: 0 group_color: group_nfs allocation score on power720-4: 0 group_color: resource_ipaddr1_single allocation score on power720-1: 1000000 group_color: resource_ipaddr1_single allocation score on power720-2: 1000 group_color: resource_ipaddr1_single allocation score on power720-4: 0 group_color: resource_nfsserver_single allocation score on power720-1: 0 group_color: resource_nfsserver_single allocation score on power720-2: 1000 group_color: resource_nfsserver_single allocation score on power720-4: 0 native_color: resource_ipaddr1_single allocation score on power720-1: 1000000 -native_color: resource_ipaddr1_single allocation score on power720-2: 2001 +native_color: resource_ipaddr1_single allocation score on power720-2: 2000 native_color: resource_ipaddr1_single allocation score on power720-4: -1000000 native_color: resource_nfsserver_single allocation score on power720-1: 0 native_color: resource_nfsserver_single allocation score on power720-2: -1000000 native_color: resource_nfsserver_single allocation score on power720-4: -1000000 diff --git a/pengine/test10/interleave-1.scores b/pengine/test10/interleave-1.scores index cfc3800bab..dfb0274bf1 100644 --- a/pengine/test10/interleave-1.scores +++ b/pengine/test10/interleave-1.scores @@ -1,345 +1,345 @@ Allocation scores: native_color: DcIPaddr allocation score on c001n09: 0 native_color: DcIPaddr allocation score on c001n02: -1000000 native_color: DcIPaddr allocation score on c001n03: -1000000 native_color: DcIPaddr allocation score on c001n04: -1000000 native_color: DcIPaddr allocation score on c001n05: -1000000 native_color: DcIPaddr allocation score on c001n06: -1000000 native_color: DcIPaddr allocation score on c001n07: -1000000 native_color: DcIPaddr allocation score on c001n08: -1000000 native_color: rsc_c001n09 allocation score on c001n09: 100 native_color: rsc_c001n09 allocation score on c001n02: 0 native_color: rsc_c001n09 allocation score on c001n03: 0 native_color: rsc_c001n09 allocation score on c001n04: 0 native_color: rsc_c001n09 allocation score on c001n05: 0 native_color: rsc_c001n09 allocation score on c001n06: 0 native_color: rsc_c001n09 allocation score on c001n07: 0 native_color: rsc_c001n09 allocation score on c001n08: 0 native_color: rsc_c001n02 allocation score on c001n09: 0 native_color: rsc_c001n02 allocation score on c001n02: 1000000 native_color: rsc_c001n02 allocation score on c001n03: 0 native_color: rsc_c001n02 allocation score on c001n04: 0 native_color: rsc_c001n02 allocation score on c001n05: 0 native_color: rsc_c001n02 allocation score on c001n06: 0 native_color: rsc_c001n02 allocation score on c001n07: 0 native_color: rsc_c001n02 allocation score on c001n08: 0 native_color: rsc_c001n03 allocation score on c001n09: 0 native_color: rsc_c001n03 allocation score on c001n02: 0 native_color: rsc_c001n03 allocation score on c001n03: 1000000 native_color: rsc_c001n03 allocation score on c001n04: 0 native_color: rsc_c001n03 allocation score on c001n05: 0 native_color: rsc_c001n03 allocation score on c001n06: 0 native_color: rsc_c001n03 allocation score on c001n07: 0 native_color: rsc_c001n03 allocation score on c001n08: 0 native_color: rsc_c001n04 allocation score on c001n09: 0 native_color: rsc_c001n04 allocation score on c001n02: 0 native_color: rsc_c001n04 allocation score on c001n03: 0 native_color: rsc_c001n04 allocation score on c001n04: 1000000 native_color: rsc_c001n04 allocation score on c001n05: 0 native_color: rsc_c001n04 allocation score on c001n06: 0 native_color: rsc_c001n04 allocation score on c001n07: 0 native_color: rsc_c001n04 allocation score on c001n08: 0 native_color: rsc_c001n05 allocation score on c001n09: 0 native_color: rsc_c001n05 allocation score on c001n02: 0 native_color: rsc_c001n05 allocation score on c001n03: 0 native_color: rsc_c001n05 allocation score on c001n04: 0 native_color: rsc_c001n05 allocation score on c001n05: 1000000 native_color: rsc_c001n05 allocation score on c001n06: 0 native_color: rsc_c001n05 allocation score on c001n07: 0 native_color: rsc_c001n05 allocation score on c001n08: 0 native_color: rsc_c001n06 allocation score on c001n09: 0 native_color: rsc_c001n06 allocation score on c001n02: 0 native_color: rsc_c001n06 allocation score on c001n03: 0 native_color: rsc_c001n06 allocation score on c001n04: 0 native_color: rsc_c001n06 allocation score on c001n05: 0 native_color: rsc_c001n06 allocation score on c001n06: 1000000 native_color: rsc_c001n06 allocation score on c001n07: 0 native_color: rsc_c001n06 allocation score on c001n08: 0 native_color: rsc_c001n07 allocation score on c001n09: 0 native_color: rsc_c001n07 allocation score on c001n02: 0 native_color: rsc_c001n07 allocation score on c001n03: 0 native_color: rsc_c001n07 allocation score on c001n04: 0 native_color: rsc_c001n07 allocation score on c001n05: 0 native_color: rsc_c001n07 allocation score on c001n06: 0 native_color: rsc_c001n07 allocation score on c001n07: 1000000 native_color: rsc_c001n07 allocation score on c001n08: 0 native_color: rsc_c001n08 allocation score on c001n09: 0 native_color: rsc_c001n08 allocation score on c001n02: 0 native_color: rsc_c001n08 allocation score on c001n03: 0 native_color: rsc_c001n08 allocation score on c001n04: 0 native_color: rsc_c001n08 allocation score on c001n05: 0 native_color: rsc_c001n08 allocation score on c001n06: 0 native_color: rsc_c001n08 allocation score on c001n07: 0 native_color: rsc_c001n08 allocation score on c001n08: 1000000 clone_color: DoFencing allocation score on c001n09: 0 clone_color: DoFencing allocation score on c001n02: 0 clone_color: DoFencing allocation score on c001n03: 0 clone_color: DoFencing allocation score on c001n04: 0 clone_color: DoFencing allocation score on c001n05: 0 clone_color: DoFencing allocation score on c001n06: 0 clone_color: DoFencing allocation score on c001n07: 0 clone_color: DoFencing allocation score on c001n08: 0 clone_color: child_DoFencing:0 allocation score on c001n09: 0 clone_color: child_DoFencing:0 allocation score on c001n02: 200 clone_color: child_DoFencing:0 allocation score on c001n03: 0 clone_color: child_DoFencing:0 allocation score on c001n04: 0 clone_color: child_DoFencing:0 allocation score on c001n05: 0 clone_color: child_DoFencing:0 allocation score on c001n06: 0 clone_color: child_DoFencing:0 allocation score on c001n07: 0 clone_color: child_DoFencing:0 allocation score on c001n08: 0 clone_color: child_DoFencing:1 allocation score on c001n09: 0 clone_color: child_DoFencing:1 allocation score on c001n02: 0 clone_color: child_DoFencing:1 allocation score on c001n03: 200 clone_color: child_DoFencing:1 allocation score on c001n04: 0 clone_color: child_DoFencing:1 allocation score on c001n05: 0 clone_color: child_DoFencing:1 allocation score on c001n06: 0 clone_color: child_DoFencing:1 allocation score on c001n07: 0 clone_color: child_DoFencing:1 allocation score on c001n08: 0 clone_color: child_DoFencing:2 allocation score on c001n09: 0 clone_color: child_DoFencing:2 allocation score on c001n02: 0 clone_color: child_DoFencing:2 allocation score on c001n03: 0 clone_color: child_DoFencing:2 allocation score on c001n04: 200 clone_color: child_DoFencing:2 allocation score on c001n05: 0 clone_color: child_DoFencing:2 allocation score on c001n06: 0 clone_color: child_DoFencing:2 allocation score on c001n07: 0 clone_color: child_DoFencing:2 allocation score on c001n08: 0 clone_color: child_DoFencing:3 allocation score on c001n09: 0 clone_color: child_DoFencing:3 allocation score on c001n02: 0 clone_color: child_DoFencing:3 allocation score on c001n03: 0 clone_color: child_DoFencing:3 allocation score on c001n04: 0 clone_color: child_DoFencing:3 allocation score on c001n05: 200 clone_color: child_DoFencing:3 allocation score on c001n06: 0 clone_color: child_DoFencing:3 allocation score on c001n07: 0 clone_color: child_DoFencing:3 allocation score on c001n08: 0 clone_color: child_DoFencing:4 allocation score on c001n09: 0 clone_color: child_DoFencing:4 allocation score on c001n02: 0 clone_color: child_DoFencing:4 allocation score on c001n03: 0 clone_color: child_DoFencing:4 allocation score on c001n04: 0 clone_color: child_DoFencing:4 allocation score on c001n05: 0 clone_color: child_DoFencing:4 allocation score on c001n06: 200 clone_color: child_DoFencing:4 allocation score on c001n07: 0 clone_color: child_DoFencing:4 allocation score on c001n08: 0 clone_color: child_DoFencing:5 allocation score on c001n09: 0 clone_color: child_DoFencing:5 allocation score on c001n02: 0 clone_color: child_DoFencing:5 allocation score on c001n03: 0 clone_color: child_DoFencing:5 allocation score on c001n04: 0 clone_color: child_DoFencing:5 allocation score on c001n05: 0 clone_color: child_DoFencing:5 allocation score on c001n06: 0 clone_color: child_DoFencing:5 allocation score on c001n07: 200 clone_color: child_DoFencing:5 allocation score on c001n08: 0 clone_color: child_DoFencing:6 allocation score on c001n09: 0 clone_color: child_DoFencing:6 allocation score on c001n02: 0 clone_color: child_DoFencing:6 allocation score on c001n03: 0 clone_color: child_DoFencing:6 allocation score on c001n04: 0 clone_color: child_DoFencing:6 allocation score on c001n05: 0 clone_color: child_DoFencing:6 allocation score on c001n06: 0 clone_color: child_DoFencing:6 allocation score on c001n07: 0 clone_color: child_DoFencing:6 allocation score on c001n08: 200 clone_color: child_DoFencing:7 allocation score on c001n09: 200 clone_color: child_DoFencing:7 allocation score on c001n02: 0 clone_color: child_DoFencing:7 allocation score on c001n03: 0 clone_color: child_DoFencing:7 allocation score on c001n04: 0 clone_color: child_DoFencing:7 allocation score on c001n05: 0 clone_color: child_DoFencing:7 allocation score on c001n06: 0 clone_color: child_DoFencing:7 allocation score on c001n07: 0 clone_color: child_DoFencing:7 allocation score on c001n08: 0 native_color: child_DoFencing:0 allocation score on c001n09: 0 native_color: child_DoFencing:0 allocation score on c001n02: 200 native_color: child_DoFencing:0 allocation score on c001n03: 0 native_color: child_DoFencing:0 allocation score on c001n04: 0 native_color: child_DoFencing:0 allocation score on c001n05: 0 native_color: child_DoFencing:0 allocation score on c001n06: 0 native_color: child_DoFencing:0 allocation score on c001n07: 0 native_color: child_DoFencing:0 allocation score on c001n08: 0 native_color: child_DoFencing:1 allocation score on c001n09: 0 native_color: child_DoFencing:1 allocation score on c001n02: -1000000 native_color: child_DoFencing:1 allocation score on c001n03: 200 native_color: child_DoFencing:1 allocation score on c001n04: 0 native_color: child_DoFencing:1 allocation score on c001n05: 0 native_color: child_DoFencing:1 allocation score on c001n06: 0 native_color: child_DoFencing:1 allocation score on c001n07: 0 native_color: child_DoFencing:1 allocation score on c001n08: 0 native_color: child_DoFencing:2 allocation score on c001n09: 0 native_color: child_DoFencing:2 allocation score on c001n02: -1000000 native_color: child_DoFencing:2 allocation score on c001n03: -1000000 native_color: child_DoFencing:2 allocation score on c001n04: 200 native_color: child_DoFencing:2 allocation score on c001n05: 0 native_color: child_DoFencing:2 allocation score on c001n06: 0 native_color: child_DoFencing:2 allocation score on c001n07: 0 native_color: child_DoFencing:2 allocation score on c001n08: 0 native_color: child_DoFencing:3 allocation score on c001n09: 0 native_color: child_DoFencing:3 allocation score on c001n02: -1000000 native_color: child_DoFencing:3 allocation score on c001n03: -1000000 native_color: child_DoFencing:3 allocation score on c001n04: -1000000 native_color: child_DoFencing:3 allocation score on c001n05: 200 native_color: child_DoFencing:3 allocation score on c001n06: 0 native_color: child_DoFencing:3 allocation score on c001n07: 0 native_color: child_DoFencing:3 allocation score on c001n08: 0 native_color: child_DoFencing:4 allocation score on c001n09: 0 native_color: child_DoFencing:4 allocation score on c001n02: -1000000 native_color: child_DoFencing:4 allocation score on c001n03: -1000000 native_color: child_DoFencing:4 allocation score on c001n04: -1000000 native_color: child_DoFencing:4 allocation score on c001n05: -1000000 native_color: child_DoFencing:4 allocation score on c001n06: 200 native_color: child_DoFencing:4 allocation score on c001n07: 0 native_color: child_DoFencing:4 allocation score on c001n08: 0 native_color: child_DoFencing:5 allocation score on c001n09: 0 native_color: child_DoFencing:5 allocation score on c001n02: -1000000 native_color: child_DoFencing:5 allocation score on c001n03: -1000000 native_color: child_DoFencing:5 allocation score on c001n04: -1000000 native_color: child_DoFencing:5 allocation score on c001n05: -1000000 native_color: child_DoFencing:5 allocation score on c001n06: -1000000 native_color: child_DoFencing:5 allocation score on c001n07: 200 native_color: child_DoFencing:5 allocation score on c001n08: 0 native_color: child_DoFencing:6 allocation score on c001n09: 0 native_color: child_DoFencing:6 allocation score on c001n02: -1000000 native_color: child_DoFencing:6 allocation score on c001n03: -1000000 native_color: child_DoFencing:6 allocation score on c001n04: -1000000 native_color: child_DoFencing:6 allocation score on c001n05: -1000000 native_color: child_DoFencing:6 allocation score on c001n06: -1000000 native_color: child_DoFencing:6 allocation score on c001n07: -1000000 native_color: child_DoFencing:6 allocation score on c001n08: 200 native_color: child_DoFencing:7 allocation score on c001n09: 200 native_color: child_DoFencing:7 allocation score on c001n02: -1000000 native_color: child_DoFencing:7 allocation score on c001n03: -1000000 native_color: child_DoFencing:7 allocation score on c001n04: -1000000 native_color: child_DoFencing:7 allocation score on c001n05: -1000000 native_color: child_DoFencing:7 allocation score on c001n06: -1000000 native_color: child_DoFencing:7 allocation score on c001n07: -1000000 native_color: child_DoFencing:7 allocation score on c001n08: -1000000 clone_color: CloneSet allocation score on c001n09: 0 clone_color: CloneSet allocation score on c001n02: 0 clone_color: CloneSet allocation score on c001n03: 0 clone_color: CloneSet allocation score on c001n04: 0 clone_color: CloneSet allocation score on c001n05: 0 clone_color: CloneSet allocation score on c001n06: 0 clone_color: CloneSet allocation score on c001n07: 0 clone_color: CloneSet allocation score on c001n08: 0 clone_color: child_CloneSet:0 allocation score on c001n09: 0 clone_color: child_CloneSet:0 allocation score on c001n02: 0 clone_color: child_CloneSet:0 allocation score on c001n03: 0 clone_color: child_CloneSet:0 allocation score on c001n04: 0 clone_color: child_CloneSet:0 allocation score on c001n05: 0 clone_color: child_CloneSet:0 allocation score on c001n06: 0 clone_color: child_CloneSet:0 allocation score on c001n07: 0 clone_color: child_CloneSet:0 allocation score on c001n08: 0 clone_color: child_CloneSet:1 allocation score on c001n09: 0 clone_color: child_CloneSet:1 allocation score on c001n02: 0 clone_color: child_CloneSet:1 allocation score on c001n03: 0 clone_color: child_CloneSet:1 allocation score on c001n04: 0 clone_color: child_CloneSet:1 allocation score on c001n05: 0 clone_color: child_CloneSet:1 allocation score on c001n06: 0 clone_color: child_CloneSet:1 allocation score on c001n07: 0 clone_color: child_CloneSet:1 allocation score on c001n08: 0 clone_color: child_CloneSet:2 allocation score on c001n09: 0 clone_color: child_CloneSet:2 allocation score on c001n02: 0 clone_color: child_CloneSet:2 allocation score on c001n03: 0 clone_color: child_CloneSet:2 allocation score on c001n04: 0 clone_color: child_CloneSet:2 allocation score on c001n05: 0 clone_color: child_CloneSet:2 allocation score on c001n06: 0 clone_color: child_CloneSet:2 allocation score on c001n07: 0 clone_color: child_CloneSet:2 allocation score on c001n08: 0 clone_color: child_CloneSet:3 allocation score on c001n09: 0 clone_color: child_CloneSet:3 allocation score on c001n02: 0 clone_color: child_CloneSet:3 allocation score on c001n03: 0 clone_color: child_CloneSet:3 allocation score on c001n04: 0 clone_color: child_CloneSet:3 allocation score on c001n05: 0 clone_color: child_CloneSet:3 allocation score on c001n06: 0 clone_color: child_CloneSet:3 allocation score on c001n07: 0 clone_color: child_CloneSet:3 allocation score on c001n08: 0 clone_color: child_CloneSet:4 allocation score on c001n09: 0 clone_color: child_CloneSet:4 allocation score on c001n02: 0 clone_color: child_CloneSet:4 allocation score on c001n03: 0 clone_color: child_CloneSet:4 allocation score on c001n04: 0 clone_color: child_CloneSet:4 allocation score on c001n05: 0 clone_color: child_CloneSet:4 allocation score on c001n06: 0 clone_color: child_CloneSet:4 allocation score on c001n07: 0 clone_color: child_CloneSet:4 allocation score on c001n08: 0 clone_color: child_CloneSet:5 allocation score on c001n09: 0 clone_color: child_CloneSet:5 allocation score on c001n02: 0 clone_color: child_CloneSet:5 allocation score on c001n03: 0 clone_color: child_CloneSet:5 allocation score on c001n04: 0 clone_color: child_CloneSet:5 allocation score on c001n05: 0 clone_color: child_CloneSet:5 allocation score on c001n06: 0 clone_color: child_CloneSet:5 allocation score on c001n07: 0 clone_color: child_CloneSet:5 allocation score on c001n08: 0 clone_color: child_CloneSet:6 allocation score on c001n09: 0 clone_color: child_CloneSet:6 allocation score on c001n02: 0 clone_color: child_CloneSet:6 allocation score on c001n03: 0 clone_color: child_CloneSet:6 allocation score on c001n04: 0 clone_color: child_CloneSet:6 allocation score on c001n05: 0 clone_color: child_CloneSet:6 allocation score on c001n06: 0 clone_color: child_CloneSet:6 allocation score on c001n07: 0 clone_color: child_CloneSet:6 allocation score on c001n08: 0 clone_color: child_CloneSet:7 allocation score on c001n09: 0 clone_color: child_CloneSet:7 allocation score on c001n02: 0 clone_color: child_CloneSet:7 allocation score on c001n03: 0 clone_color: child_CloneSet:7 allocation score on c001n04: 0 clone_color: child_CloneSet:7 allocation score on c001n05: 0 clone_color: child_CloneSet:7 allocation score on c001n06: 0 clone_color: child_CloneSet:7 allocation score on c001n07: 0 clone_color: child_CloneSet:7 allocation score on c001n08: 0 -native_color: child_CloneSet:0 allocation score on c001n09: 200 -native_color: child_CloneSet:0 allocation score on c001n02: 200 -native_color: child_CloneSet:0 allocation score on c001n03: 200 -native_color: child_CloneSet:0 allocation score on c001n04: 200 -native_color: child_CloneSet:0 allocation score on c001n05: 200 -native_color: child_CloneSet:0 allocation score on c001n06: 200 -native_color: child_CloneSet:0 allocation score on c001n07: 200 -native_color: child_CloneSet:0 allocation score on c001n08: 200 +native_color: child_CloneSet:0 allocation score on c001n09: 0 +native_color: child_CloneSet:0 allocation score on c001n02: 0 +native_color: child_CloneSet:0 allocation score on c001n03: 0 +native_color: child_CloneSet:0 allocation score on c001n04: 0 +native_color: child_CloneSet:0 allocation score on c001n05: 0 +native_color: child_CloneSet:0 allocation score on c001n06: 0 +native_color: child_CloneSet:0 allocation score on c001n07: 0 +native_color: child_CloneSet:0 allocation score on c001n08: 0 native_color: child_CloneSet:1 allocation score on c001n09: -1000000 -native_color: child_CloneSet:1 allocation score on c001n02: 200 -native_color: child_CloneSet:1 allocation score on c001n03: 200 -native_color: child_CloneSet:1 allocation score on c001n04: 200 -native_color: child_CloneSet:1 allocation score on c001n05: 200 -native_color: child_CloneSet:1 allocation score on c001n06: 200 -native_color: child_CloneSet:1 allocation score on c001n07: 200 -native_color: child_CloneSet:1 allocation score on c001n08: 200 +native_color: child_CloneSet:1 allocation score on c001n02: 0 +native_color: child_CloneSet:1 allocation score on c001n03: 0 +native_color: child_CloneSet:1 allocation score on c001n04: 0 +native_color: child_CloneSet:1 allocation score on c001n05: 0 +native_color: child_CloneSet:1 allocation score on c001n06: 0 +native_color: child_CloneSet:1 allocation score on c001n07: 0 +native_color: child_CloneSet:1 allocation score on c001n08: 0 native_color: child_CloneSet:2 allocation score on c001n09: -1000000 native_color: child_CloneSet:2 allocation score on c001n02: -1000000 -native_color: child_CloneSet:2 allocation score on c001n03: 200 -native_color: child_CloneSet:2 allocation score on c001n04: 200 -native_color: child_CloneSet:2 allocation score on c001n05: 200 -native_color: child_CloneSet:2 allocation score on c001n06: 200 -native_color: child_CloneSet:2 allocation score on c001n07: 200 -native_color: child_CloneSet:2 allocation score on c001n08: 200 +native_color: child_CloneSet:2 allocation score on c001n03: 0 +native_color: child_CloneSet:2 allocation score on c001n04: 0 +native_color: child_CloneSet:2 allocation score on c001n05: 0 +native_color: child_CloneSet:2 allocation score on c001n06: 0 +native_color: child_CloneSet:2 allocation score on c001n07: 0 +native_color: child_CloneSet:2 allocation score on c001n08: 0 native_color: child_CloneSet:3 allocation score on c001n09: -1000000 native_color: child_CloneSet:3 allocation score on c001n02: -1000000 native_color: child_CloneSet:3 allocation score on c001n03: -1000000 -native_color: child_CloneSet:3 allocation score on c001n04: 200 -native_color: child_CloneSet:3 allocation score on c001n05: 200 -native_color: child_CloneSet:3 allocation score on c001n06: 200 -native_color: child_CloneSet:3 allocation score on c001n07: 200 -native_color: child_CloneSet:3 allocation score on c001n08: 200 +native_color: child_CloneSet:3 allocation score on c001n04: 0 +native_color: child_CloneSet:3 allocation score on c001n05: 0 +native_color: child_CloneSet:3 allocation score on c001n06: 0 +native_color: child_CloneSet:3 allocation score on c001n07: 0 +native_color: child_CloneSet:3 allocation score on c001n08: 0 native_color: child_CloneSet:4 allocation score on c001n09: -1000000 native_color: child_CloneSet:4 allocation score on c001n02: -1000000 native_color: child_CloneSet:4 allocation score on c001n03: -1000000 native_color: child_CloneSet:4 allocation score on c001n04: -1000000 -native_color: child_CloneSet:4 allocation score on c001n05: 200 -native_color: child_CloneSet:4 allocation score on c001n06: 200 -native_color: child_CloneSet:4 allocation score on c001n07: 200 -native_color: child_CloneSet:4 allocation score on c001n08: 200 +native_color: child_CloneSet:4 allocation score on c001n05: 0 +native_color: child_CloneSet:4 allocation score on c001n06: 0 +native_color: child_CloneSet:4 allocation score on c001n07: 0 +native_color: child_CloneSet:4 allocation score on c001n08: 0 native_color: child_CloneSet:5 allocation score on c001n09: -1000000 native_color: child_CloneSet:5 allocation score on c001n02: -1000000 native_color: child_CloneSet:5 allocation score on c001n03: -1000000 native_color: child_CloneSet:5 allocation score on c001n04: -1000000 native_color: child_CloneSet:5 allocation score on c001n05: -1000000 -native_color: child_CloneSet:5 allocation score on c001n06: 200 -native_color: child_CloneSet:5 allocation score on c001n07: 200 -native_color: child_CloneSet:5 allocation score on c001n08: 200 +native_color: child_CloneSet:5 allocation score on c001n06: 0 +native_color: child_CloneSet:5 allocation score on c001n07: 0 +native_color: child_CloneSet:5 allocation score on c001n08: 0 native_color: child_CloneSet:6 allocation score on c001n09: -1000000 native_color: child_CloneSet:6 allocation score on c001n02: -1000000 native_color: child_CloneSet:6 allocation score on c001n03: -1000000 native_color: child_CloneSet:6 allocation score on c001n04: -1000000 native_color: child_CloneSet:6 allocation score on c001n05: -1000000 native_color: child_CloneSet:6 allocation score on c001n06: -1000000 -native_color: child_CloneSet:6 allocation score on c001n07: 200 -native_color: child_CloneSet:6 allocation score on c001n08: 200 +native_color: child_CloneSet:6 allocation score on c001n07: 0 +native_color: child_CloneSet:6 allocation score on c001n08: 0 native_color: child_CloneSet:7 allocation score on c001n09: -1000000 native_color: child_CloneSet:7 allocation score on c001n02: -1000000 native_color: child_CloneSet:7 allocation score on c001n03: -1000000 native_color: child_CloneSet:7 allocation score on c001n04: -1000000 native_color: child_CloneSet:7 allocation score on c001n05: -1000000 native_color: child_CloneSet:7 allocation score on c001n06: -1000000 native_color: child_CloneSet:7 allocation score on c001n07: -1000000 -native_color: child_CloneSet:7 allocation score on c001n08: 200 +native_color: child_CloneSet:7 allocation score on c001n08: 0 diff --git a/pengine/test10/interleave-2.scores b/pengine/test10/interleave-2.scores index cfc3800bab..dfb0274bf1 100644 --- a/pengine/test10/interleave-2.scores +++ b/pengine/test10/interleave-2.scores @@ -1,345 +1,345 @@ Allocation scores: native_color: DcIPaddr allocation score on c001n09: 0 native_color: DcIPaddr allocation score on c001n02: -1000000 native_color: DcIPaddr allocation score on c001n03: -1000000 native_color: DcIPaddr allocation score on c001n04: -1000000 native_color: DcIPaddr allocation score on c001n05: -1000000 native_color: DcIPaddr allocation score on c001n06: -1000000 native_color: DcIPaddr allocation score on c001n07: -1000000 native_color: DcIPaddr allocation score on c001n08: -1000000 native_color: rsc_c001n09 allocation score on c001n09: 100 native_color: rsc_c001n09 allocation score on c001n02: 0 native_color: rsc_c001n09 allocation score on c001n03: 0 native_color: rsc_c001n09 allocation score on c001n04: 0 native_color: rsc_c001n09 allocation score on c001n05: 0 native_color: rsc_c001n09 allocation score on c001n06: 0 native_color: rsc_c001n09 allocation score on c001n07: 0 native_color: rsc_c001n09 allocation score on c001n08: 0 native_color: rsc_c001n02 allocation score on c001n09: 0 native_color: rsc_c001n02 allocation score on c001n02: 1000000 native_color: rsc_c001n02 allocation score on c001n03: 0 native_color: rsc_c001n02 allocation score on c001n04: 0 native_color: rsc_c001n02 allocation score on c001n05: 0 native_color: rsc_c001n02 allocation score on c001n06: 0 native_color: rsc_c001n02 allocation score on c001n07: 0 native_color: rsc_c001n02 allocation score on c001n08: 0 native_color: rsc_c001n03 allocation score on c001n09: 0 native_color: rsc_c001n03 allocation score on c001n02: 0 native_color: rsc_c001n03 allocation score on c001n03: 1000000 native_color: rsc_c001n03 allocation score on c001n04: 0 native_color: rsc_c001n03 allocation score on c001n05: 0 native_color: rsc_c001n03 allocation score on c001n06: 0 native_color: rsc_c001n03 allocation score on c001n07: 0 native_color: rsc_c001n03 allocation score on c001n08: 0 native_color: rsc_c001n04 allocation score on c001n09: 0 native_color: rsc_c001n04 allocation score on c001n02: 0 native_color: rsc_c001n04 allocation score on c001n03: 0 native_color: rsc_c001n04 allocation score on c001n04: 1000000 native_color: rsc_c001n04 allocation score on c001n05: 0 native_color: rsc_c001n04 allocation score on c001n06: 0 native_color: rsc_c001n04 allocation score on c001n07: 0 native_color: rsc_c001n04 allocation score on c001n08: 0 native_color: rsc_c001n05 allocation score on c001n09: 0 native_color: rsc_c001n05 allocation score on c001n02: 0 native_color: rsc_c001n05 allocation score on c001n03: 0 native_color: rsc_c001n05 allocation score on c001n04: 0 native_color: rsc_c001n05 allocation score on c001n05: 1000000 native_color: rsc_c001n05 allocation score on c001n06: 0 native_color: rsc_c001n05 allocation score on c001n07: 0 native_color: rsc_c001n05 allocation score on c001n08: 0 native_color: rsc_c001n06 allocation score on c001n09: 0 native_color: rsc_c001n06 allocation score on c001n02: 0 native_color: rsc_c001n06 allocation score on c001n03: 0 native_color: rsc_c001n06 allocation score on c001n04: 0 native_color: rsc_c001n06 allocation score on c001n05: 0 native_color: rsc_c001n06 allocation score on c001n06: 1000000 native_color: rsc_c001n06 allocation score on c001n07: 0 native_color: rsc_c001n06 allocation score on c001n08: 0 native_color: rsc_c001n07 allocation score on c001n09: 0 native_color: rsc_c001n07 allocation score on c001n02: 0 native_color: rsc_c001n07 allocation score on c001n03: 0 native_color: rsc_c001n07 allocation score on c001n04: 0 native_color: rsc_c001n07 allocation score on c001n05: 0 native_color: rsc_c001n07 allocation score on c001n06: 0 native_color: rsc_c001n07 allocation score on c001n07: 1000000 native_color: rsc_c001n07 allocation score on c001n08: 0 native_color: rsc_c001n08 allocation score on c001n09: 0 native_color: rsc_c001n08 allocation score on c001n02: 0 native_color: rsc_c001n08 allocation score on c001n03: 0 native_color: rsc_c001n08 allocation score on c001n04: 0 native_color: rsc_c001n08 allocation score on c001n05: 0 native_color: rsc_c001n08 allocation score on c001n06: 0 native_color: rsc_c001n08 allocation score on c001n07: 0 native_color: rsc_c001n08 allocation score on c001n08: 1000000 clone_color: DoFencing allocation score on c001n09: 0 clone_color: DoFencing allocation score on c001n02: 0 clone_color: DoFencing allocation score on c001n03: 0 clone_color: DoFencing allocation score on c001n04: 0 clone_color: DoFencing allocation score on c001n05: 0 clone_color: DoFencing allocation score on c001n06: 0 clone_color: DoFencing allocation score on c001n07: 0 clone_color: DoFencing allocation score on c001n08: 0 clone_color: child_DoFencing:0 allocation score on c001n09: 0 clone_color: child_DoFencing:0 allocation score on c001n02: 200 clone_color: child_DoFencing:0 allocation score on c001n03: 0 clone_color: child_DoFencing:0 allocation score on c001n04: 0 clone_color: child_DoFencing:0 allocation score on c001n05: 0 clone_color: child_DoFencing:0 allocation score on c001n06: 0 clone_color: child_DoFencing:0 allocation score on c001n07: 0 clone_color: child_DoFencing:0 allocation score on c001n08: 0 clone_color: child_DoFencing:1 allocation score on c001n09: 0 clone_color: child_DoFencing:1 allocation score on c001n02: 0 clone_color: child_DoFencing:1 allocation score on c001n03: 200 clone_color: child_DoFencing:1 allocation score on c001n04: 0 clone_color: child_DoFencing:1 allocation score on c001n05: 0 clone_color: child_DoFencing:1 allocation score on c001n06: 0 clone_color: child_DoFencing:1 allocation score on c001n07: 0 clone_color: child_DoFencing:1 allocation score on c001n08: 0 clone_color: child_DoFencing:2 allocation score on c001n09: 0 clone_color: child_DoFencing:2 allocation score on c001n02: 0 clone_color: child_DoFencing:2 allocation score on c001n03: 0 clone_color: child_DoFencing:2 allocation score on c001n04: 200 clone_color: child_DoFencing:2 allocation score on c001n05: 0 clone_color: child_DoFencing:2 allocation score on c001n06: 0 clone_color: child_DoFencing:2 allocation score on c001n07: 0 clone_color: child_DoFencing:2 allocation score on c001n08: 0 clone_color: child_DoFencing:3 allocation score on c001n09: 0 clone_color: child_DoFencing:3 allocation score on c001n02: 0 clone_color: child_DoFencing:3 allocation score on c001n03: 0 clone_color: child_DoFencing:3 allocation score on c001n04: 0 clone_color: child_DoFencing:3 allocation score on c001n05: 200 clone_color: child_DoFencing:3 allocation score on c001n06: 0 clone_color: child_DoFencing:3 allocation score on c001n07: 0 clone_color: child_DoFencing:3 allocation score on c001n08: 0 clone_color: child_DoFencing:4 allocation score on c001n09: 0 clone_color: child_DoFencing:4 allocation score on c001n02: 0 clone_color: child_DoFencing:4 allocation score on c001n03: 0 clone_color: child_DoFencing:4 allocation score on c001n04: 0 clone_color: child_DoFencing:4 allocation score on c001n05: 0 clone_color: child_DoFencing:4 allocation score on c001n06: 200 clone_color: child_DoFencing:4 allocation score on c001n07: 0 clone_color: child_DoFencing:4 allocation score on c001n08: 0 clone_color: child_DoFencing:5 allocation score on c001n09: 0 clone_color: child_DoFencing:5 allocation score on c001n02: 0 clone_color: child_DoFencing:5 allocation score on c001n03: 0 clone_color: child_DoFencing:5 allocation score on c001n04: 0 clone_color: child_DoFencing:5 allocation score on c001n05: 0 clone_color: child_DoFencing:5 allocation score on c001n06: 0 clone_color: child_DoFencing:5 allocation score on c001n07: 200 clone_color: child_DoFencing:5 allocation score on c001n08: 0 clone_color: child_DoFencing:6 allocation score on c001n09: 0 clone_color: child_DoFencing:6 allocation score on c001n02: 0 clone_color: child_DoFencing:6 allocation score on c001n03: 0 clone_color: child_DoFencing:6 allocation score on c001n04: 0 clone_color: child_DoFencing:6 allocation score on c001n05: 0 clone_color: child_DoFencing:6 allocation score on c001n06: 0 clone_color: child_DoFencing:6 allocation score on c001n07: 0 clone_color: child_DoFencing:6 allocation score on c001n08: 200 clone_color: child_DoFencing:7 allocation score on c001n09: 200 clone_color: child_DoFencing:7 allocation score on c001n02: 0 clone_color: child_DoFencing:7 allocation score on c001n03: 0 clone_color: child_DoFencing:7 allocation score on c001n04: 0 clone_color: child_DoFencing:7 allocation score on c001n05: 0 clone_color: child_DoFencing:7 allocation score on c001n06: 0 clone_color: child_DoFencing:7 allocation score on c001n07: 0 clone_color: child_DoFencing:7 allocation score on c001n08: 0 native_color: child_DoFencing:0 allocation score on c001n09: 0 native_color: child_DoFencing:0 allocation score on c001n02: 200 native_color: child_DoFencing:0 allocation score on c001n03: 0 native_color: child_DoFencing:0 allocation score on c001n04: 0 native_color: child_DoFencing:0 allocation score on c001n05: 0 native_color: child_DoFencing:0 allocation score on c001n06: 0 native_color: child_DoFencing:0 allocation score on c001n07: 0 native_color: child_DoFencing:0 allocation score on c001n08: 0 native_color: child_DoFencing:1 allocation score on c001n09: 0 native_color: child_DoFencing:1 allocation score on c001n02: -1000000 native_color: child_DoFencing:1 allocation score on c001n03: 200 native_color: child_DoFencing:1 allocation score on c001n04: 0 native_color: child_DoFencing:1 allocation score on c001n05: 0 native_color: child_DoFencing:1 allocation score on c001n06: 0 native_color: child_DoFencing:1 allocation score on c001n07: 0 native_color: child_DoFencing:1 allocation score on c001n08: 0 native_color: child_DoFencing:2 allocation score on c001n09: 0 native_color: child_DoFencing:2 allocation score on c001n02: -1000000 native_color: child_DoFencing:2 allocation score on c001n03: -1000000 native_color: child_DoFencing:2 allocation score on c001n04: 200 native_color: child_DoFencing:2 allocation score on c001n05: 0 native_color: child_DoFencing:2 allocation score on c001n06: 0 native_color: child_DoFencing:2 allocation score on c001n07: 0 native_color: child_DoFencing:2 allocation score on c001n08: 0 native_color: child_DoFencing:3 allocation score on c001n09: 0 native_color: child_DoFencing:3 allocation score on c001n02: -1000000 native_color: child_DoFencing:3 allocation score on c001n03: -1000000 native_color: child_DoFencing:3 allocation score on c001n04: -1000000 native_color: child_DoFencing:3 allocation score on c001n05: 200 native_color: child_DoFencing:3 allocation score on c001n06: 0 native_color: child_DoFencing:3 allocation score on c001n07: 0 native_color: child_DoFencing:3 allocation score on c001n08: 0 native_color: child_DoFencing:4 allocation score on c001n09: 0 native_color: child_DoFencing:4 allocation score on c001n02: -1000000 native_color: child_DoFencing:4 allocation score on c001n03: -1000000 native_color: child_DoFencing:4 allocation score on c001n04: -1000000 native_color: child_DoFencing:4 allocation score on c001n05: -1000000 native_color: child_DoFencing:4 allocation score on c001n06: 200 native_color: child_DoFencing:4 allocation score on c001n07: 0 native_color: child_DoFencing:4 allocation score on c001n08: 0 native_color: child_DoFencing:5 allocation score on c001n09: 0 native_color: child_DoFencing:5 allocation score on c001n02: -1000000 native_color: child_DoFencing:5 allocation score on c001n03: -1000000 native_color: child_DoFencing:5 allocation score on c001n04: -1000000 native_color: child_DoFencing:5 allocation score on c001n05: -1000000 native_color: child_DoFencing:5 allocation score on c001n06: -1000000 native_color: child_DoFencing:5 allocation score on c001n07: 200 native_color: child_DoFencing:5 allocation score on c001n08: 0 native_color: child_DoFencing:6 allocation score on c001n09: 0 native_color: child_DoFencing:6 allocation score on c001n02: -1000000 native_color: child_DoFencing:6 allocation score on c001n03: -1000000 native_color: child_DoFencing:6 allocation score on c001n04: -1000000 native_color: child_DoFencing:6 allocation score on c001n05: -1000000 native_color: child_DoFencing:6 allocation score on c001n06: -1000000 native_color: child_DoFencing:6 allocation score on c001n07: -1000000 native_color: child_DoFencing:6 allocation score on c001n08: 200 native_color: child_DoFencing:7 allocation score on c001n09: 200 native_color: child_DoFencing:7 allocation score on c001n02: -1000000 native_color: child_DoFencing:7 allocation score on c001n03: -1000000 native_color: child_DoFencing:7 allocation score on c001n04: -1000000 native_color: child_DoFencing:7 allocation score on c001n05: -1000000 native_color: child_DoFencing:7 allocation score on c001n06: -1000000 native_color: child_DoFencing:7 allocation score on c001n07: -1000000 native_color: child_DoFencing:7 allocation score on c001n08: -1000000 clone_color: CloneSet allocation score on c001n09: 0 clone_color: CloneSet allocation score on c001n02: 0 clone_color: CloneSet allocation score on c001n03: 0 clone_color: CloneSet allocation score on c001n04: 0 clone_color: CloneSet allocation score on c001n05: 0 clone_color: CloneSet allocation score on c001n06: 0 clone_color: CloneSet allocation score on c001n07: 0 clone_color: CloneSet allocation score on c001n08: 0 clone_color: child_CloneSet:0 allocation score on c001n09: 0 clone_color: child_CloneSet:0 allocation score on c001n02: 0 clone_color: child_CloneSet:0 allocation score on c001n03: 0 clone_color: child_CloneSet:0 allocation score on c001n04: 0 clone_color: child_CloneSet:0 allocation score on c001n05: 0 clone_color: child_CloneSet:0 allocation score on c001n06: 0 clone_color: child_CloneSet:0 allocation score on c001n07: 0 clone_color: child_CloneSet:0 allocation score on c001n08: 0 clone_color: child_CloneSet:1 allocation score on c001n09: 0 clone_color: child_CloneSet:1 allocation score on c001n02: 0 clone_color: child_CloneSet:1 allocation score on c001n03: 0 clone_color: child_CloneSet:1 allocation score on c001n04: 0 clone_color: child_CloneSet:1 allocation score on c001n05: 0 clone_color: child_CloneSet:1 allocation score on c001n06: 0 clone_color: child_CloneSet:1 allocation score on c001n07: 0 clone_color: child_CloneSet:1 allocation score on c001n08: 0 clone_color: child_CloneSet:2 allocation score on c001n09: 0 clone_color: child_CloneSet:2 allocation score on c001n02: 0 clone_color: child_CloneSet:2 allocation score on c001n03: 0 clone_color: child_CloneSet:2 allocation score on c001n04: 0 clone_color: child_CloneSet:2 allocation score on c001n05: 0 clone_color: child_CloneSet:2 allocation score on c001n06: 0 clone_color: child_CloneSet:2 allocation score on c001n07: 0 clone_color: child_CloneSet:2 allocation score on c001n08: 0 clone_color: child_CloneSet:3 allocation score on c001n09: 0 clone_color: child_CloneSet:3 allocation score on c001n02: 0 clone_color: child_CloneSet:3 allocation score on c001n03: 0 clone_color: child_CloneSet:3 allocation score on c001n04: 0 clone_color: child_CloneSet:3 allocation score on c001n05: 0 clone_color: child_CloneSet:3 allocation score on c001n06: 0 clone_color: child_CloneSet:3 allocation score on c001n07: 0 clone_color: child_CloneSet:3 allocation score on c001n08: 0 clone_color: child_CloneSet:4 allocation score on c001n09: 0 clone_color: child_CloneSet:4 allocation score on c001n02: 0 clone_color: child_CloneSet:4 allocation score on c001n03: 0 clone_color: child_CloneSet:4 allocation score on c001n04: 0 clone_color: child_CloneSet:4 allocation score on c001n05: 0 clone_color: child_CloneSet:4 allocation score on c001n06: 0 clone_color: child_CloneSet:4 allocation score on c001n07: 0 clone_color: child_CloneSet:4 allocation score on c001n08: 0 clone_color: child_CloneSet:5 allocation score on c001n09: 0 clone_color: child_CloneSet:5 allocation score on c001n02: 0 clone_color: child_CloneSet:5 allocation score on c001n03: 0 clone_color: child_CloneSet:5 allocation score on c001n04: 0 clone_color: child_CloneSet:5 allocation score on c001n05: 0 clone_color: child_CloneSet:5 allocation score on c001n06: 0 clone_color: child_CloneSet:5 allocation score on c001n07: 0 clone_color: child_CloneSet:5 allocation score on c001n08: 0 clone_color: child_CloneSet:6 allocation score on c001n09: 0 clone_color: child_CloneSet:6 allocation score on c001n02: 0 clone_color: child_CloneSet:6 allocation score on c001n03: 0 clone_color: child_CloneSet:6 allocation score on c001n04: 0 clone_color: child_CloneSet:6 allocation score on c001n05: 0 clone_color: child_CloneSet:6 allocation score on c001n06: 0 clone_color: child_CloneSet:6 allocation score on c001n07: 0 clone_color: child_CloneSet:6 allocation score on c001n08: 0 clone_color: child_CloneSet:7 allocation score on c001n09: 0 clone_color: child_CloneSet:7 allocation score on c001n02: 0 clone_color: child_CloneSet:7 allocation score on c001n03: 0 clone_color: child_CloneSet:7 allocation score on c001n04: 0 clone_color: child_CloneSet:7 allocation score on c001n05: 0 clone_color: child_CloneSet:7 allocation score on c001n06: 0 clone_color: child_CloneSet:7 allocation score on c001n07: 0 clone_color: child_CloneSet:7 allocation score on c001n08: 0 -native_color: child_CloneSet:0 allocation score on c001n09: 200 -native_color: child_CloneSet:0 allocation score on c001n02: 200 -native_color: child_CloneSet:0 allocation score on c001n03: 200 -native_color: child_CloneSet:0 allocation score on c001n04: 200 -native_color: child_CloneSet:0 allocation score on c001n05: 200 -native_color: child_CloneSet:0 allocation score on c001n06: 200 -native_color: child_CloneSet:0 allocation score on c001n07: 200 -native_color: child_CloneSet:0 allocation score on c001n08: 200 +native_color: child_CloneSet:0 allocation score on c001n09: 0 +native_color: child_CloneSet:0 allocation score on c001n02: 0 +native_color: child_CloneSet:0 allocation score on c001n03: 0 +native_color: child_CloneSet:0 allocation score on c001n04: 0 +native_color: child_CloneSet:0 allocation score on c001n05: 0 +native_color: child_CloneSet:0 allocation score on c001n06: 0 +native_color: child_CloneSet:0 allocation score on c001n07: 0 +native_color: child_CloneSet:0 allocation score on c001n08: 0 native_color: child_CloneSet:1 allocation score on c001n09: -1000000 -native_color: child_CloneSet:1 allocation score on c001n02: 200 -native_color: child_CloneSet:1 allocation score on c001n03: 200 -native_color: child_CloneSet:1 allocation score on c001n04: 200 -native_color: child_CloneSet:1 allocation score on c001n05: 200 -native_color: child_CloneSet:1 allocation score on c001n06: 200 -native_color: child_CloneSet:1 allocation score on c001n07: 200 -native_color: child_CloneSet:1 allocation score on c001n08: 200 +native_color: child_CloneSet:1 allocation score on c001n02: 0 +native_color: child_CloneSet:1 allocation score on c001n03: 0 +native_color: child_CloneSet:1 allocation score on c001n04: 0 +native_color: child_CloneSet:1 allocation score on c001n05: 0 +native_color: child_CloneSet:1 allocation score on c001n06: 0 +native_color: child_CloneSet:1 allocation score on c001n07: 0 +native_color: child_CloneSet:1 allocation score on c001n08: 0 native_color: child_CloneSet:2 allocation score on c001n09: -1000000 native_color: child_CloneSet:2 allocation score on c001n02: -1000000 -native_color: child_CloneSet:2 allocation score on c001n03: 200 -native_color: child_CloneSet:2 allocation score on c001n04: 200 -native_color: child_CloneSet:2 allocation score on c001n05: 200 -native_color: child_CloneSet:2 allocation score on c001n06: 200 -native_color: child_CloneSet:2 allocation score on c001n07: 200 -native_color: child_CloneSet:2 allocation score on c001n08: 200 +native_color: child_CloneSet:2 allocation score on c001n03: 0 +native_color: child_CloneSet:2 allocation score on c001n04: 0 +native_color: child_CloneSet:2 allocation score on c001n05: 0 +native_color: child_CloneSet:2 allocation score on c001n06: 0 +native_color: child_CloneSet:2 allocation score on c001n07: 0 +native_color: child_CloneSet:2 allocation score on c001n08: 0 native_color: child_CloneSet:3 allocation score on c001n09: -1000000 native_color: child_CloneSet:3 allocation score on c001n02: -1000000 native_color: child_CloneSet:3 allocation score on c001n03: -1000000 -native_color: child_CloneSet:3 allocation score on c001n04: 200 -native_color: child_CloneSet:3 allocation score on c001n05: 200 -native_color: child_CloneSet:3 allocation score on c001n06: 200 -native_color: child_CloneSet:3 allocation score on c001n07: 200 -native_color: child_CloneSet:3 allocation score on c001n08: 200 +native_color: child_CloneSet:3 allocation score on c001n04: 0 +native_color: child_CloneSet:3 allocation score on c001n05: 0 +native_color: child_CloneSet:3 allocation score on c001n06: 0 +native_color: child_CloneSet:3 allocation score on c001n07: 0 +native_color: child_CloneSet:3 allocation score on c001n08: 0 native_color: child_CloneSet:4 allocation score on c001n09: -1000000 native_color: child_CloneSet:4 allocation score on c001n02: -1000000 native_color: child_CloneSet:4 allocation score on c001n03: -1000000 native_color: child_CloneSet:4 allocation score on c001n04: -1000000 -native_color: child_CloneSet:4 allocation score on c001n05: 200 -native_color: child_CloneSet:4 allocation score on c001n06: 200 -native_color: child_CloneSet:4 allocation score on c001n07: 200 -native_color: child_CloneSet:4 allocation score on c001n08: 200 +native_color: child_CloneSet:4 allocation score on c001n05: 0 +native_color: child_CloneSet:4 allocation score on c001n06: 0 +native_color: child_CloneSet:4 allocation score on c001n07: 0 +native_color: child_CloneSet:4 allocation score on c001n08: 0 native_color: child_CloneSet:5 allocation score on c001n09: -1000000 native_color: child_CloneSet:5 allocation score on c001n02: -1000000 native_color: child_CloneSet:5 allocation score on c001n03: -1000000 native_color: child_CloneSet:5 allocation score on c001n04: -1000000 native_color: child_CloneSet:5 allocation score on c001n05: -1000000 -native_color: child_CloneSet:5 allocation score on c001n06: 200 -native_color: child_CloneSet:5 allocation score on c001n07: 200 -native_color: child_CloneSet:5 allocation score on c001n08: 200 +native_color: child_CloneSet:5 allocation score on c001n06: 0 +native_color: child_CloneSet:5 allocation score on c001n07: 0 +native_color: child_CloneSet:5 allocation score on c001n08: 0 native_color: child_CloneSet:6 allocation score on c001n09: -1000000 native_color: child_CloneSet:6 allocation score on c001n02: -1000000 native_color: child_CloneSet:6 allocation score on c001n03: -1000000 native_color: child_CloneSet:6 allocation score on c001n04: -1000000 native_color: child_CloneSet:6 allocation score on c001n05: -1000000 native_color: child_CloneSet:6 allocation score on c001n06: -1000000 -native_color: child_CloneSet:6 allocation score on c001n07: 200 -native_color: child_CloneSet:6 allocation score on c001n08: 200 +native_color: child_CloneSet:6 allocation score on c001n07: 0 +native_color: child_CloneSet:6 allocation score on c001n08: 0 native_color: child_CloneSet:7 allocation score on c001n09: -1000000 native_color: child_CloneSet:7 allocation score on c001n02: -1000000 native_color: child_CloneSet:7 allocation score on c001n03: -1000000 native_color: child_CloneSet:7 allocation score on c001n04: -1000000 native_color: child_CloneSet:7 allocation score on c001n05: -1000000 native_color: child_CloneSet:7 allocation score on c001n06: -1000000 native_color: child_CloneSet:7 allocation score on c001n07: -1000000 -native_color: child_CloneSet:7 allocation score on c001n08: 200 +native_color: child_CloneSet:7 allocation score on c001n08: 0 diff --git a/pengine/test10/master-demote.scores b/pengine/test10/master-demote.scores index 2a5ba0071a..5ae3e68ba6 100644 --- a/pengine/test10/master-demote.scores +++ b/pengine/test10/master-demote.scores @@ -1,76 +1,76 @@ Allocation scores: clone_color: cyrus_drbd allocation score on cxa1: 210 clone_color: cyrus_drbd allocation score on cxb1: 200 clone_color: cyrus_drbd_node:0 allocation score on cxa1: 76 clone_color: cyrus_drbd_node:0 allocation score on cxb1: 0 clone_color: cyrus_drbd_node:1 allocation score on cxa1: 0 clone_color: cyrus_drbd_node:1 allocation score on cxb1: 76 native_color: cyrus_drbd_node:0 allocation score on cxa1: 76 native_color: cyrus_drbd_node:0 allocation score on cxb1: 0 native_color: cyrus_drbd_node:1 allocation score on cxa1: -1000000 native_color: cyrus_drbd_node:1 allocation score on cxb1: 76 cyrus_drbd_node:0 promotion score on cxa1: 285 cyrus_drbd_node:1 promotion score on cxb1: 275 -native_color: cyrus_address allocation score on cxa1: 286 -native_color: cyrus_address allocation score on cxb1: 276 +native_color: cyrus_address allocation score on cxa1: 210 +native_color: cyrus_address allocation score on cxb1: 200 cyrus_drbd_node:0 promotion score on cxa1: 1000000 cyrus_drbd_node:1 promotion score on cxb1: -1000000 native_color: cyrus_volgroup allocation score on cxa1: -1000000 native_color: cyrus_volgroup allocation score on cxb1: -1000000 native_color: cyrus_filesys allocation score on cxa1: -1000000 native_color: cyrus_filesys allocation score on cxb1: -1000000 native_color: cyrus_syslogd allocation score on cxa1: -1000000 native_color: cyrus_syslogd allocation score on cxb1: -1000000 native_color: cyrus_master allocation score on cxa1: -1000000 native_color: cyrus_master allocation score on cxb1: -1000000 cyrus_drbd_node:0 promotion score on cxa1: 1000000 cyrus_drbd_node:1 promotion score on cxb1: -1000000 clone_color: named_drbd allocation score on cxa1: 200 clone_color: named_drbd allocation score on cxb1: 210 clone_color: named_drbd_node:0 allocation score on cxa1: 75 clone_color: named_drbd_node:0 allocation score on cxb1: 76 clone_color: named_drbd_node:1 allocation score on cxa1: 76 clone_color: named_drbd_node:1 allocation score on cxb1: 75 native_color: named_drbd_node:0 allocation score on cxa1: 75 native_color: named_drbd_node:0 allocation score on cxb1: 76 native_color: named_drbd_node:1 allocation score on cxa1: 76 native_color: named_drbd_node:1 allocation score on cxb1: -1000000 named_drbd_node:0 promotion score on cxb1: 285 named_drbd_node:1 promotion score on cxa1: 275 named_drbd_node:2 promotion score on none: 0 -native_color: named_address allocation score on cxa1: 276 -native_color: named_address allocation score on cxb1: 286 +native_color: named_address allocation score on cxa1: 200 +native_color: named_address allocation score on cxb1: 210 named_drbd_node:0 promotion score on cxb1: 1000000 named_drbd_node:1 promotion score on cxa1: -1000000 named_drbd_node:2 promotion score on none: 0 native_color: named_volgroup allocation score on cxa1: -1000000 native_color: named_volgroup allocation score on cxb1: -1000000 native_color: named_filesys allocation score on cxa1: -1000000 native_color: named_filesys allocation score on cxb1: -1000000 native_color: named_syslogd allocation score on cxa1: -1000000 native_color: named_syslogd allocation score on cxb1: -1000000 native_color: named_daemon allocation score on cxa1: -1000000 native_color: named_daemon allocation score on cxb1: -1000000 named_drbd_node:0 promotion score on cxb1: 1000000 named_drbd_node:1 promotion score on cxa1: -1000000 named_drbd_node:2 promotion score on none: 0 clone_color: pingd_clone allocation score on cxa1: 0 clone_color: pingd_clone allocation score on cxb1: 0 clone_color: pingd_node:0 allocation score on cxa1: 1 clone_color: pingd_node:0 allocation score on cxb1: 0 clone_color: pingd_node:1 allocation score on cxa1: 0 clone_color: pingd_node:1 allocation score on cxb1: 1 native_color: pingd_node:0 allocation score on cxa1: 1 native_color: pingd_node:0 allocation score on cxb1: 0 native_color: pingd_node:1 allocation score on cxa1: -1000000 native_color: pingd_node:1 allocation score on cxb1: 1 clone_color: fence_clone allocation score on cxa1: 0 clone_color: fence_clone allocation score on cxb1: 0 clone_color: fence_node:0 allocation score on cxa1: 1 clone_color: fence_node:0 allocation score on cxb1: 0 clone_color: fence_node:1 allocation score on cxa1: 0 clone_color: fence_node:1 allocation score on cxb1: 1 native_color: fence_node:0 allocation score on cxa1: 1 native_color: fence_node:0 allocation score on cxb1: 0 native_color: fence_node:1 allocation score on cxa1: -1000000 native_color: fence_node:1 allocation score on cxb1: 1 diff --git a/pengine/test10/migrate-5.scores b/pengine/test10/migrate-5.scores index 613281b415..35573800c3 100644 --- a/pengine/test10/migrate-5.scores +++ b/pengine/test10/migrate-5.scores @@ -1,25 +1,25 @@ Allocation scores: clone_color: clone-dom0-iscsi1 allocation score on dom0-02: -1000000 clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:0 allocation score on dom0-01: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: domU-test01 allocation score on dom0-02: -1000000 -native_color: domU-test01 allocation score on dom0-01: 1 +native_color: domU-test01 allocation score on dom0-01: 0 diff --git a/pengine/test10/migrate-start-complex.scores b/pengine/test10/migrate-start-complex.scores index 30cd5b9749..ce5ae5e8d7 100644 --- a/pengine/test10/migrate-start-complex.scores +++ b/pengine/test10/migrate-start-complex.scores @@ -1,37 +1,37 @@ Allocation scores: clone_color: clone-bottom allocation score on dom0-02: 10000 clone_color: clone-bottom allocation score on dom0-01: 1000000 clone_color: bottom:0 allocation score on dom0-02: 0 clone_color: bottom:0 allocation score on dom0-01: 0 clone_color: bottom:1 allocation score on dom0-02: 0 clone_color: bottom:1 allocation score on dom0-01: 0 native_color: bottom:0 allocation score on dom0-02: 0 native_color: bottom:0 allocation score on dom0-01: 0 native_color: bottom:1 allocation score on dom0-02: -1000000 native_color: bottom:1 allocation score on dom0-01: 0 clone_color: clone-dom0-iscsi1 allocation score on dom0-02: 10000 clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 1000000 clone_color: dom0-iscsi1:0 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1:0 allocation score on dom0-02: 0 group_color: dom0-iscsi1:0 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 group_color: dom0-iscsi1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 0 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 0 -native_color: domU-test01 allocation score on dom0-02: 10001 +native_color: domU-test01 allocation score on dom0-02: 10000 native_color: domU-test01 allocation score on dom0-01: 1000000 native_color: top allocation score on dom0-02: -1000000 native_color: top allocation score on dom0-01: 0 diff --git a/pengine/test10/migrate-start.scores b/pengine/test10/migrate-start.scores index 16cb9c6284..5635cf5870 100644 --- a/pengine/test10/migrate-start.scores +++ b/pengine/test10/migrate-start.scores @@ -1,25 +1,25 @@ Allocation scores: clone_color: clone-dom0-iscsi1 allocation score on dom0-02: 5000 clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 1000000 clone_color: dom0-iscsi1:0 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1:0 allocation score on dom0-02: 0 group_color: dom0-iscsi1:0 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 group_color: dom0-iscsi1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 0 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 0 -native_color: domU-test01 allocation score on dom0-02: 5001 +native_color: domU-test01 allocation score on dom0-02: 5000 native_color: domU-test01 allocation score on dom0-01: 1000000 diff --git a/pengine/test10/migrate-stop-complex.scores b/pengine/test10/migrate-stop-complex.scores index 19b6dea0d1..8808f000ca 100644 --- a/pengine/test10/migrate-stop-complex.scores +++ b/pengine/test10/migrate-stop-complex.scores @@ -1,37 +1,37 @@ Allocation scores: clone_color: clone-bottom allocation score on dom0-02: -1000000 clone_color: clone-bottom allocation score on dom0-01: 0 clone_color: bottom:0 allocation score on dom0-02: 0 clone_color: bottom:0 allocation score on dom0-01: 1 clone_color: bottom:1 allocation score on dom0-02: 1 clone_color: bottom:1 allocation score on dom0-01: 0 native_color: bottom:0 allocation score on dom0-02: -1000000 native_color: bottom:0 allocation score on dom0-01: 1 native_color: bottom:1 allocation score on dom0-02: -1000000 native_color: bottom:1 allocation score on dom0-01: -1000000 clone_color: clone-dom0-iscsi1 allocation score on dom0-02: -1000000 -clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 1 +clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:0 allocation score on dom0-01: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: domU-test01 allocation score on dom0-02: -1000000 -native_color: domU-test01 allocation score on dom0-01: 2 +native_color: domU-test01 allocation score on dom0-01: 0 native_color: top allocation score on dom0-02: -1000000 native_color: top allocation score on dom0-01: 0 diff --git a/pengine/test10/migrate-stop-start-complex.scores b/pengine/test10/migrate-stop-start-complex.scores index eb8b8d5fdf..5ab66b274c 100644 --- a/pengine/test10/migrate-stop-start-complex.scores +++ b/pengine/test10/migrate-stop-start-complex.scores @@ -1,37 +1,37 @@ Allocation scores: clone_color: clone-dom0-iscsi1 allocation score on dom0-02: -1000000 clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 5000 clone_color: dom0-iscsi1:0 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 clone_color: clone-bottom allocation score on dom0-02: -1000000 clone_color: clone-bottom allocation score on dom0-01: 10000 clone_color: bottom:0 allocation score on dom0-02: 1 clone_color: bottom:0 allocation score on dom0-01: 0 clone_color: bottom:1 allocation score on dom0-02: 0 clone_color: bottom:1 allocation score on dom0-01: 0 native_color: bottom:0 allocation score on dom0-02: -1000000 native_color: bottom:0 allocation score on dom0-01: 0 native_color: bottom:1 allocation score on dom0-02: -1000000 native_color: bottom:1 allocation score on dom0-01: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:0 allocation score on dom0-01: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: domU-test01 allocation score on dom0-02: -1000000 -native_color: domU-test01 allocation score on dom0-01: 5001 +native_color: domU-test01 allocation score on dom0-01: 5000 native_color: top allocation score on dom0-02: -1000000 native_color: top allocation score on dom0-01: 5000 diff --git a/pengine/test10/migrate-stop.scores b/pengine/test10/migrate-stop.scores index 613281b415..35573800c3 100644 --- a/pengine/test10/migrate-stop.scores +++ b/pengine/test10/migrate-stop.scores @@ -1,25 +1,25 @@ Allocation scores: clone_color: clone-dom0-iscsi1 allocation score on dom0-02: -1000000 clone_color: clone-dom0-iscsi1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: 1 clone_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1:1 allocation score on dom0-01: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: 0 clone_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:1 allocation score on dom0-01: 0 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:1 allocation score on dom0-01: 1 group_color: dom0-iscsi1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1:0 allocation score on dom0-01: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 group_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-02: -1000000 native_color: dom0-iscsi1-cnx1:0 allocation score on dom0-01: -1000000 native_color: domU-test01 allocation score on dom0-02: -1000000 -native_color: domU-test01 allocation score on dom0-01: 1 +native_color: domU-test01 allocation score on dom0-01: 0 diff --git a/pengine/test10/probe-2.scores b/pengine/test10/probe-2.scores index f44d15d2bf..5bf8161ba9 100644 --- a/pengine/test10/probe-2.scores +++ b/pengine/test10/probe-2.scores @@ -1,155 +1,155 @@ Allocation scores: group_color: group_www_data allocation score on wc01: 0 group_color: group_www_data allocation score on wc02: 0 group_color: fs_www_data allocation score on wc01: 0 group_color: fs_www_data allocation score on wc02: 0 group_color: nfs-kernel-server allocation score on wc01: 0 group_color: nfs-kernel-server allocation score on wc02: 0 group_color: intip_nfs allocation score on wc01: 0 group_color: intip_nfs allocation score on wc02: 0 clone_color: clone_nfs-common allocation score on wc01: 0 clone_color: clone_nfs-common allocation score on wc02: -1000000 clone_color: group_nfs-common:0 allocation score on wc01: 0 clone_color: group_nfs-common:0 allocation score on wc02: 0 clone_color: nfs-common:0 allocation score on wc01: 1 clone_color: nfs-common:0 allocation score on wc02: 0 clone_color: group_nfs-common:1 allocation score on wc01: 0 clone_color: group_nfs-common:1 allocation score on wc02: 0 clone_color: nfs-common:1 allocation score on wc01: 0 clone_color: nfs-common:1 allocation score on wc02: 1 group_color: group_nfs-common:0 allocation score on wc01: 0 group_color: group_nfs-common:0 allocation score on wc02: -1000000 group_color: nfs-common:0 allocation score on wc01: 1 group_color: nfs-common:0 allocation score on wc02: -1000000 native_color: nfs-common:0 allocation score on wc01: 1 native_color: nfs-common:0 allocation score on wc02: -1000000 group_color: group_nfs-common:1 allocation score on wc01: -1000000 group_color: group_nfs-common:1 allocation score on wc02: -1000000 group_color: nfs-common:1 allocation score on wc01: -1000000 group_color: nfs-common:1 allocation score on wc02: -1000000 native_color: nfs-common:1 allocation score on wc01: -1000000 native_color: nfs-common:1 allocation score on wc02: -1000000 -clone_color: ms_drbd_www allocation score on wc01: 1 +clone_color: ms_drbd_www allocation score on wc01: 0 clone_color: ms_drbd_www allocation score on wc02: -1000000 clone_color: drbd_www:0 allocation score on wc01: 76 clone_color: drbd_www:0 allocation score on wc02: 0 clone_color: drbd_www:1 allocation score on wc01: 0 clone_color: drbd_www:1 allocation score on wc02: 1 native_color: drbd_www:0 allocation score on wc01: 76 native_color: drbd_www:0 allocation score on wc02: -1000000 native_color: drbd_www:1 allocation score on wc01: -1000000 native_color: drbd_www:1 allocation score on wc02: -1000000 -drbd_www:0 promotion score on wc01: 177 +drbd_www:0 promotion score on wc01: 175 drbd_www:1 promotion score on none: 0 -native_color: fs_www_data allocation score on wc01: 77 +native_color: fs_www_data allocation score on wc01: 76 native_color: fs_www_data allocation score on wc02: -1000000 native_color: nfs-kernel-server allocation score on wc01: 0 native_color: nfs-kernel-server allocation score on wc02: -1000000 native_color: intip_nfs allocation score on wc01: 0 native_color: intip_nfs allocation score on wc02: -1000000 clone_color: ms_drbd_mysql allocation score on wc01: 0 clone_color: ms_drbd_mysql allocation score on wc02: -1000000 clone_color: drbd_mysql:0 allocation score on wc01: 76 clone_color: drbd_mysql:0 allocation score on wc02: 0 clone_color: drbd_mysql:1 allocation score on wc01: 0 clone_color: drbd_mysql:1 allocation score on wc02: 1 native_color: drbd_mysql:0 allocation score on wc01: 76 native_color: drbd_mysql:0 allocation score on wc02: -1000000 native_color: drbd_mysql:1 allocation score on wc01: -1000000 native_color: drbd_mysql:1 allocation score on wc02: -1000000 drbd_mysql:0 promotion score on wc01: 75 drbd_mysql:1 promotion score on none: 0 group_color: group_mysql allocation score on wc01: 0 group_color: group_mysql allocation score on wc02: 0 group_color: fs_mysql allocation score on wc01: 0 group_color: fs_mysql allocation score on wc02: 0 group_color: intip_sql allocation score on wc01: 0 group_color: intip_sql allocation score on wc02: 0 group_color: mysql-server allocation score on wc01: 0 group_color: mysql-server allocation score on wc02: 0 drbd_mysql:0 promotion score on wc01: 1000000 drbd_mysql:1 promotion score on none: 0 native_color: fs_mysql allocation score on wc01: 76 native_color: fs_mysql allocation score on wc02: -1000000 native_color: intip_sql allocation score on wc01: 0 native_color: intip_sql allocation score on wc02: -1000000 native_color: mysql-server allocation score on wc01: 0 native_color: mysql-server allocation score on wc02: -1000000 drbd_www:0 promotion score on wc01: 1000000 drbd_www:1 promotion score on none: 0 clone_color: clone_mysql-proxy allocation score on wc01: 0 clone_color: clone_mysql-proxy allocation score on wc02: 0 clone_color: group_mysql-proxy:0 allocation score on wc01: 0 clone_color: group_mysql-proxy:0 allocation score on wc02: 0 clone_color: mysql-proxy:0 allocation score on wc01: 1 clone_color: mysql-proxy:0 allocation score on wc02: 0 clone_color: group_mysql-proxy:1 allocation score on wc01: 0 clone_color: group_mysql-proxy:1 allocation score on wc02: 0 clone_color: mysql-proxy:1 allocation score on wc01: 0 clone_color: mysql-proxy:1 allocation score on wc02: 1 group_color: group_mysql-proxy:0 allocation score on wc01: 0 group_color: group_mysql-proxy:0 allocation score on wc02: -1000000 group_color: mysql-proxy:0 allocation score on wc01: 1 group_color: mysql-proxy:0 allocation score on wc02: -1000000 native_color: mysql-proxy:0 allocation score on wc01: 1 native_color: mysql-proxy:0 allocation score on wc02: -1000000 group_color: group_mysql-proxy:1 allocation score on wc01: -1000000 group_color: group_mysql-proxy:1 allocation score on wc02: -1000000 group_color: mysql-proxy:1 allocation score on wc01: -1000000 group_color: mysql-proxy:1 allocation score on wc02: -1000000 native_color: mysql-proxy:1 allocation score on wc01: -1000000 native_color: mysql-proxy:1 allocation score on wc02: -1000000 clone_color: clone_webservice allocation score on wc01: 0 clone_color: clone_webservice allocation score on wc02: -1000000 clone_color: group_webservice:0 allocation score on wc01: 0 clone_color: group_webservice:0 allocation score on wc02: 0 clone_color: fs_www:0 allocation score on wc01: 1 clone_color: fs_www:0 allocation score on wc02: 0 clone_color: apache2:0 allocation score on wc01: 1 clone_color: apache2:0 allocation score on wc02: 0 clone_color: group_webservice:1 allocation score on wc01: 0 clone_color: group_webservice:1 allocation score on wc02: 0 clone_color: fs_www:1 allocation score on wc01: 0 clone_color: fs_www:1 allocation score on wc02: 1 clone_color: apache2:1 allocation score on wc01: 0 clone_color: apache2:1 allocation score on wc02: 1 group_color: group_webservice:0 allocation score on wc01: 0 group_color: group_webservice:0 allocation score on wc02: -1000000 group_color: fs_www:0 allocation score on wc01: 1 group_color: fs_www:0 allocation score on wc02: -1000000 group_color: apache2:0 allocation score on wc01: 1 group_color: apache2:0 allocation score on wc02: -1000000 -native_color: fs_www:0 allocation score on wc01: 3 +native_color: fs_www:0 allocation score on wc01: 2 native_color: fs_www:0 allocation score on wc02: -1000000 native_color: apache2:0 allocation score on wc01: 1 native_color: apache2:0 allocation score on wc02: -1000000 group_color: group_webservice:1 allocation score on wc01: -1000000 group_color: group_webservice:1 allocation score on wc02: -1000000 group_color: fs_www:1 allocation score on wc01: -1000000 group_color: fs_www:1 allocation score on wc02: -1000000 group_color: apache2:1 allocation score on wc01: -1000000 group_color: apache2:1 allocation score on wc02: -1000000 native_color: fs_www:1 allocation score on wc01: -1000000 native_color: fs_www:1 allocation score on wc02: -1000000 native_color: apache2:1 allocation score on wc01: -1000000 native_color: apache2:1 allocation score on wc02: -1000000 group_color: group_ftpd allocation score on wc01: 0 group_color: group_ftpd allocation score on wc02: 0 group_color: extip_ftp allocation score on wc01: 0 group_color: extip_ftp allocation score on wc02: 0 group_color: pure-ftpd allocation score on wc01: 0 group_color: pure-ftpd allocation score on wc02: 0 -native_color: extip_ftp allocation score on wc01: 3 +native_color: extip_ftp allocation score on wc01: 0 native_color: extip_ftp allocation score on wc02: -1000000 native_color: pure-ftpd allocation score on wc01: 0 native_color: pure-ftpd allocation score on wc02: -1000000 clone_color: DoFencing allocation score on wc01: 0 clone_color: DoFencing allocation score on wc02: 0 clone_color: stonith_rackpdu:0 allocation score on wc01: 1 clone_color: stonith_rackpdu:0 allocation score on wc02: 0 clone_color: stonith_rackpdu:1 allocation score on wc01: 0 clone_color: stonith_rackpdu:1 allocation score on wc02: 1 native_color: stonith_rackpdu:0 allocation score on wc01: 1 native_color: stonith_rackpdu:0 allocation score on wc02: -1000000 native_color: stonith_rackpdu:1 allocation score on wc01: -1000000 native_color: stonith_rackpdu:1 allocation score on wc02: -1000000