commit 261c6b836e4a44c6d20d5abd7550ef1f0b25c17c Author: David Vossel Date: Wed Sep 25 17:47:04 2013 -0400 fix orphaned connection resources diff --git a/crmd/lrm.c b/crmd/lrm.c index 7157e24..5f4d3bb 100644 --- a/crmd/lrm.c +++ b/crmd/lrm.c @@ -729,6 +729,13 @@ build_active_RAs(lrm_state_t * lrm_state, xmlNode * rsc_list) crm_xml_add(xml_rsc, XML_AGENT_ATTR_CLASS, entry->rsc.class); crm_xml_add(xml_rsc, XML_AGENT_ATTR_PROVIDER, entry->rsc.provider); + if (entry->last && entry->last->params) { + const char *container = g_hash_table_lookup(entry->last->params, CRM_META"_"XML_RSC_ATTR_CONTAINER); + if (container) { + crm_trace("Resource %s is a part of container resource %s", entry->id, container); + crm_xml_add(xml_rsc, XML_RSC_ATTR_CONTAINER, container); + } + } build_operation_update(xml_rsc, &(entry->rsc), entry->last, __FUNCTION__); build_operation_update(xml_rsc, &(entry->rsc), entry->failed, __FUNCTION__); for (gIter = entry->recurring_op_list; gIter != NULL; gIter = gIter->next) { @@ -1930,10 +1937,20 @@ do_update_resource(lrm_state_t * lrm_state, lrmd_rsc_info_t * rsc, lrmd_event_da build_operation_update(iter, rsc, op, __FUNCTION__); if (rsc) { + const char *container = NULL; + crm_xml_add(iter, XML_ATTR_TYPE, rsc->type); crm_xml_add(iter, XML_AGENT_ATTR_CLASS, rsc->class); crm_xml_add(iter, XML_AGENT_ATTR_PROVIDER, rsc->provider); + if (op->params) { + container = g_hash_table_lookup(op->params, CRM_META"_"XML_RSC_ATTR_CONTAINER); + } + if (container) { + crm_trace("Resource %s is a part of container resource %s", op->rsc_id, container); + crm_xml_add(iter, XML_RSC_ATTR_CONTAINER, container); + } + CRM_CHECK(rsc->type != NULL, crm_err("Resource %s has no value for type", op->rsc_id)); CRM_CHECK(rsc->class != NULL, crm_err("Resource %s has no value for class", op->rsc_id)); diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h index bd3d923..8eb4a1d 100644 --- a/include/crm/pengine/status.h +++ b/include/crm/pengine/status.h @@ -160,6 +160,7 @@ struct node_s { # define pe_rsc_orphan 0x00000001ULL # define pe_rsc_managed 0x00000002ULL # define pe_rsc_block 0x00000004ULL /* Further operations are prohibited due to failure policy */ +# define pe_rsc_orphan_container_filler 0x00000008ULL # define pe_rsc_notify 0x00000010ULL # define pe_rsc_unique 0x00000020ULL diff --git a/lib/cib/cib_attrs.c b/lib/cib/cib_attrs.c index d1e1b74..5e21eef 100644 --- a/lib/cib/cib_attrs.c +++ b/lib/cib/cib_attrs.c @@ -414,40 +414,54 @@ delete_attr_delegate(cib_t * the_cib, int options, return rc; } -static int -get_remote_node_uuid(cib_t * the_cib, const char *uname, char **uuid) +static gboolean +found_remote_node_xpath(cib_t *the_cib, const char *xpath) { -#define REMOTE_NODE_XPATH "//nvpair[@name='remote-node'][@value='%s']" -#define REMOTE_NODE_XPATH2 "//primitive[@type='remote'][@provider='pacemaker'][@id='%s']" int rc = pcmk_ok; - char *xpath_string = NULL; - size_t len = strlen(REMOTE_NODE_XPATH) + strlen(uname) + 1; xmlNode *xml_search = NULL; - xpath_string = calloc(1, len); - sprintf(xpath_string, REMOTE_NODE_XPATH, uname); - rc = cib_internal_op(the_cib, CIB_OP_QUERY, NULL, xpath_string, NULL, &xml_search, + rc = cib_internal_op(the_cib, CIB_OP_QUERY, NULL, xpath, NULL, &xml_search, cib_sync_call | cib_scope_local | cib_xpath, NULL); - free(xpath_string); free(xml_search); - xml_search = NULL; - xpath_string = NULL; - if (rc != pcmk_ok) { - len = strlen(REMOTE_NODE_XPATH2) + strlen(uname) + 1; - xpath_string = calloc(1, len); - sprintf(xpath_string, REMOTE_NODE_XPATH2, uname); - rc = cib_internal_op(the_cib, CIB_OP_QUERY, NULL, xpath_string, NULL, &xml_search, - cib_sync_call | cib_scope_local | cib_xpath, NULL); + return rc == pcmk_ok ? TRUE : FALSE; +} - free(xpath_string); - free(xml_search); +static int +get_remote_node_uuid(cib_t * the_cib, const char *uname, char **uuid) +{ +#define CONTAINER_REMOTE_NODE_XPATH "//" XML_CIB_TAG_NVPAIR "[@name='remote-node'][@value='%s']" +#define BAREMETAL_REMOTE_NODE_XPATH "//" XML_CIB_TAG_RESOURCE "[@type='remote'][@provider='pacemaker'][@id='%s']" +#define ORPHAN_REMOTE_NODE_XPATH "//" XML_CIB_TAG_STATUS "//" XML_CIB_TAG_STATE "[@id='%s'][@remote_node='true']" + int len = 128 + strlen(uname); + int rc = pcmk_ok; + char *xpath_string = calloc(1, len); + + sprintf(xpath_string, CONTAINER_REMOTE_NODE_XPATH, uname); + if (found_remote_node_xpath(the_cib, xpath_string)) { + goto found_remote; } - if (rc == pcmk_ok) { - *uuid = strdup(uname); + sprintf(xpath_string, BAREMETAL_REMOTE_NODE_XPATH, uname); + if (found_remote_node_xpath(the_cib, xpath_string)) { + goto found_remote; + } + + sprintf(xpath_string, ORPHAN_REMOTE_NODE_XPATH, uname); + if (found_remote_node_xpath(the_cib, xpath_string)) { + goto found_remote; } + rc = -1; +found_remote: + if (rc == pcmk_ok) { + /* reuse allocation */ + *uuid = xpath_string; + strcpy(*uuid, uname); + } else { + *uuid = NULL; + free(xpath_string); + } return rc; } diff --git a/lib/pengine/complex.c b/lib/pengine/complex.c index 5e2f4e0..8a6049d 100644 --- a/lib/pengine/complex.c +++ b/lib/pengine/complex.c @@ -159,6 +159,10 @@ get_rsc_attributes(GHashTable * meta_hash, resource_t * rsc, unpack_instance_attributes(data_set->input, rsc->xml, XML_TAG_ATTR_SETS, node_hash, meta_hash, NULL, FALSE, data_set->now); + if (rsc->container) { + g_hash_table_replace(meta_hash, strdup(CRM_META"_"XML_RSC_ATTR_CONTAINER), strdup(rsc->container->id)); + } + /* set anything else based on the parent */ if (rsc->parent != NULL) { get_rsc_attributes(meta_hash, rsc->parent, node, data_set); diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c index b4986dd..26cecb2 100644 --- a/lib/pengine/unpack.c +++ b/lib/pengine/unpack.c @@ -248,6 +248,7 @@ create_node(const char *id, const char *uname, const char *type, const char *sco if (safe_str_eq(type, "remote")) { new_node->details->type = node_remote; + set_bit(data_set->flags, pe_flag_have_remote_nodes); } else if (type == NULL || safe_str_eq(type, "member") || safe_str_eq(type, NORMALNODE)) { new_node->details->type = node_member; @@ -612,7 +613,6 @@ unpack_remote_nodes(xmlNode * xml_resources, pe_working_set_t * data_set) } if (new_node_id) { - set_bit(data_set->flags, pe_flag_have_remote_nodes); crm_trace("detected remote node %s", new_node_id); create_node(new_node_id, new_node_id, "remote", NULL, data_set); } @@ -1399,6 +1399,22 @@ create_fake_resource(const char *rsc_id, xmlNode * rsc_entry, pe_working_set_t * return NULL; } + if (is_remote_node(xml_rsc)) { + node_t *node; + + crm_debug("Detected orphaned remote node %s", rsc_id); + rsc->is_remote_node = TRUE; + node = create_node(rsc_id, rsc_id, "remote", NULL, data_set); + + CRM_ASSERT(node != NULL); + node->details->remote_rsc = rsc; + } + + if (crm_element_value(rsc_entry, XML_RSC_ATTR_CONTAINER)) { + /* This orphaned rsc needs to be mapped to a container. */ + crm_trace("Detected orphaned container filler %s", rsc_id); + set_bit(rsc->flags, pe_rsc_orphan_container_filler); + } set_bit(rsc->flags, pe_rsc_orphan); data_set->resources = g_list_append(data_set->resources, rsc); return rsc; @@ -1860,7 +1876,7 @@ calculate_active_ops(GListPtr sorted_op_list, int *start_index, int *stop_index) } } -static void +static resource_t * unpack_lrm_rsc_state(node_t * node, xmlNode * rsc_entry, pe_working_set_t * data_set) { GListPtr gIter = NULL; @@ -1896,7 +1912,7 @@ unpack_lrm_rsc_state(node_t * node, xmlNode * rsc_entry, pe_working_set_t * data if (op_list == NULL) { /* if there are no operations, there is nothing to do */ - return; + return NULL; } /* find the resource */ @@ -1949,12 +1965,55 @@ unpack_lrm_rsc_state(node_t * node, xmlNode * rsc_entry, pe_working_set_t * data if (saved_role > rsc->role) { rsc->role = saved_role; } + + return rsc; +} + +static void +handle_orphaned_container_fillers(xmlNode * lrm_rsc_list, pe_working_set_t * data_set) +{ + xmlNode *rsc_entry = NULL; + for (rsc_entry = __xml_first_child(lrm_rsc_list); rsc_entry != NULL; + rsc_entry = __xml_next(rsc_entry)) { + + resource_t *rsc; + resource_t *container; + const char *rsc_id; + const char *container_id; + + if (safe_str_neq((const char *)rsc_entry->name, XML_LRM_TAG_RESOURCE)) { + continue; + } + + container_id = crm_element_value(rsc_entry, XML_RSC_ATTR_CONTAINER); + rsc_id = crm_element_value(rsc_entry, XML_ATTR_ID); + if (container_id == NULL || rsc_id == NULL) { + continue; + } + + container = pe_find_resource(data_set->resources, container_id); + if (container == NULL) { + continue; + } + + rsc = pe_find_resource(data_set->resources, rsc_id); + if (rsc == NULL || + is_set(rsc->flags, pe_rsc_orphan_container_filler) == FALSE || + rsc->container != NULL) { + continue; + } + + pe_rsc_trace(rsc, "Mapped orphaned rsc %s's container to %s", rsc->id, container_id); + rsc->container = container; + container->fillers = g_list_append(container->fillers, rsc); + } } gboolean unpack_lrm_resources(node_t * node, xmlNode * lrm_rsc_list, pe_working_set_t * data_set) { xmlNode *rsc_entry = NULL; + gboolean found_orphaned_container_filler = FALSE; CRM_CHECK(node != NULL, return FALSE); @@ -1962,11 +2021,23 @@ unpack_lrm_resources(node_t * node, xmlNode * lrm_rsc_list, pe_working_set_t * d for (rsc_entry = __xml_first_child(lrm_rsc_list); rsc_entry != NULL; rsc_entry = __xml_next(rsc_entry)) { + if (crm_str_eq((const char *)rsc_entry->name, XML_LRM_TAG_RESOURCE, TRUE)) { - unpack_lrm_rsc_state(node, rsc_entry, data_set); + resource_t *rsc; + rsc = unpack_lrm_rsc_state(node, rsc_entry, data_set); + if (rsc && is_set(rsc->flags, pe_rsc_orphan_container_filler)) { + found_orphaned_container_filler = TRUE; + } } } + /* now that all the resource state has been unpacked for this node + * we have to go back and map any orphaned container fillers to their + * container resource */ + if (found_orphaned_container_filler) { + handle_orphaned_container_fillers(lrm_rsc_list, data_set); + } + return TRUE; } diff --git a/pengine/allocate.c b/pengine/allocate.c index bfa8e7b..e535b84 100644 --- a/pengine/allocate.c +++ b/pengine/allocate.c @@ -1576,10 +1576,10 @@ apply_remote_node_ordering(pe_working_set_t *data_set) remote_rsc = action->node->details->remote_rsc; container = remote_rsc->container; + if (safe_str_eq(action->task, "monitor") || safe_str_eq(action->task, "start") || safe_str_eq(action->task, "promote") || - safe_str_eq(action->task, "demote") || safe_str_eq(action->task, CRM_OP_LRM_REFRESH) || safe_str_eq(action->task, CRM_OP_CLEAR_FAILCOUNT) || safe_str_eq(action->task, "delete")) { @@ -1593,6 +1593,39 @@ apply_remote_node_ordering(pe_working_set_t *data_set) pe_order_implies_then | pe_order_runnable_left, data_set); + } else if (safe_str_eq(action->task, "demote")) { + + /* If the connection is being torn down, we don't want + * to build a constraint between a resource's demotion and + * the connection resource starting... because the connection + * resource can not start. The connection might already be up, + * but the START action would not be allowed which in turn would + * block the demotion of any resournces living in the remote-node. + * + * In this case, only build the constraint between the demotion and + * the connection's stop action. This allows the connection and all the + * resources within the remote-node to be torn down properly. */ + if (remote_rsc->next_role == RSC_ROLE_STOPPED) { + custom_action_order(action->rsc, + NULL, + action, + remote_rsc, + generate_op_key(remote_rsc->id, RSC_STOP, 0), + NULL, + pe_order_implies_first, + data_set); + } else { + + custom_action_order(remote_rsc, + generate_op_key(remote_rsc->id, RSC_START, 0), + NULL, + action->rsc, + NULL, + action, + pe_order_implies_then | pe_order_runnable_left, + data_set); + } + } else if (safe_str_eq(action->task, "stop") && container && is_set(container->flags, pe_rsc_failed)) { diff --git a/pengine/test10/container-1.exp b/pengine/test10/container-1.exp index 1924ef8..522b0f1 100644 --- a/pengine/test10/container-1.exp +++ b/pengine/test10/container-1.exp @@ -47,7 +47,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -86,7 +86,7 @@ - + diff --git a/pengine/test10/container-2.exp b/pengine/test10/container-2.exp index d699d28..c5f9e9e 100644 --- a/pengine/test10/container-2.exp +++ b/pengine/test10/container-2.exp @@ -45,7 +45,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -108,7 +108,7 @@ - + diff --git a/pengine/test10/container-3.exp b/pengine/test10/container-3.exp index cc774da..3c2703a 100644 --- a/pengine/test10/container-3.exp +++ b/pengine/test10/container-3.exp @@ -42,7 +42,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/pengine/test10/container-4.exp b/pengine/test10/container-4.exp index 72f50cc..d1da381 100644 --- a/pengine/test10/container-4.exp +++ b/pengine/test10/container-4.exp @@ -45,7 +45,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -112,7 +112,7 @@ - + diff --git a/pengine/test10/container-group-1.exp b/pengine/test10/container-group-1.exp index a007f84..b14aa4c 100644 --- a/pengine/test10/container-group-1.exp +++ b/pengine/test10/container-group-1.exp @@ -79,7 +79,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/pengine/test10/container-group-2.exp b/pengine/test10/container-group-2.exp index 6d5e283..ce32cc3 100644 --- a/pengine/test10/container-group-2.exp +++ b/pengine/test10/container-group-2.exp @@ -113,7 +113,7 @@ - + @@ -132,7 +132,7 @@ - + @@ -148,7 +148,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -183,7 +183,7 @@ - + @@ -196,7 +196,7 @@ - + diff --git a/pengine/test10/container-group-3.exp b/pengine/test10/container-group-3.exp index 4df7279..96d99c6 100644 --- a/pengine/test10/container-group-3.exp +++ b/pengine/test10/container-group-3.exp @@ -101,7 +101,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -143,7 +143,7 @@ - + diff --git a/pengine/test10/container-group-4.exp b/pengine/test10/container-group-4.exp index dd5aad7..6128599 100644 --- a/pengine/test10/container-group-4.exp +++ b/pengine/test10/container-group-4.exp @@ -113,7 +113,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -196,7 +196,7 @@ - + diff --git a/pengine/test10/whitebox-asymmetric.exp b/pengine/test10/whitebox-asymmetric.exp index 2c7e586..d60cffa 100644 --- a/pengine/test10/whitebox-asymmetric.exp +++ b/pengine/test10/whitebox-asymmetric.exp @@ -32,7 +32,7 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/pengine/test10/whitebox-fail1.exp b/pengine/test10/whitebox-fail1.exp index 5741955..b298df5 100644 --- a/pengine/test10/whitebox-fail1.exp +++ b/pengine/test10/whitebox-fail1.exp @@ -173,7 +173,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -198,7 +198,7 @@ - + diff --git a/pengine/test10/whitebox-fail2.exp b/pengine/test10/whitebox-fail2.exp index 5741955..b298df5 100644 --- a/pengine/test10/whitebox-fail2.exp +++ b/pengine/test10/whitebox-fail2.exp @@ -173,7 +173,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -198,7 +198,7 @@ - + diff --git a/pengine/test10/whitebox-fail3.exp b/pengine/test10/whitebox-fail3.exp index 1b8d144..c5a6474 100644 --- a/pengine/test10/whitebox-fail3.exp +++ b/pengine/test10/whitebox-fail3.exp @@ -151,7 +151,7 @@ - + @@ -164,7 +164,7 @@ - + @@ -180,7 +180,7 @@ - + diff --git a/pengine/test10/whitebox-move.exp b/pengine/test10/whitebox-move.exp index 8dbdda0..60262b6 100644 --- a/pengine/test10/whitebox-move.exp +++ b/pengine/test10/whitebox-move.exp @@ -168,7 +168,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -197,7 +197,7 @@ - + diff --git a/pengine/test10/whitebox-orphan-ms.dot b/pengine/test10/whitebox-orphan-ms.dot new file mode 100644 index 0000000..f037179 --- /dev/null +++ b/pengine/test10/whitebox-orphan-ms.dot @@ -0,0 +1,69 @@ + digraph "g" { +"FencingFail_start_0 18node1" [ style=bold color="green" fontcolor="black"] +"FencingFail_stop_0 18node3" -> "FencingFail_start_0 18node1" [ style = bold] +"FencingFail_stop_0 18node3" -> "all_stopped" [ style = bold] +"FencingFail_stop_0 18node3" [ style=bold color="green" fontcolor="black"] +"all_stopped" [ style=bold color="green" fontcolor="orange"] +"container1_delete_0 18node1" -> "container1_start_0 " [ style = dashed] +"container1_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"container1_delete_0 18node2" -> "container1_start_0 " [ style = dashed] +"container1_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"container1_delete_0 18node3" -> "container1_start_0 " [ style = dashed] +"container1_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"container1_start_0 " [ style=dashed color="red" fontcolor="black"] +"container1_stop_0 18node1" -> "all_stopped" [ style = bold] +"container1_stop_0 18node1" -> "container1_delete_0 18node1" [ style = bold] +"container1_stop_0 18node1" -> "container1_delete_0 18node2" [ style = bold] +"container1_stop_0 18node1" -> "container1_delete_0 18node3" [ style = bold] +"container1_stop_0 18node1" -> "container1_start_0 " [ style = dashed] +"container1_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +"container2_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"container2_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"container2_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"container2_stop_0 18node1" -> "all_stopped" [ style = bold] +"container2_stop_0 18node1" -> "container2_delete_0 18node1" [ style = bold] +"container2_stop_0 18node1" -> "container2_delete_0 18node2" [ style = bold] +"container2_stop_0 18node1" -> "container2_delete_0 18node3" [ style = bold] +"container2_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"lxc-ms_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"lxc-ms_demote_0 lxc1" -> "lxc-ms_stop_0 lxc1" [ style = bold] +"lxc-ms_demote_0 lxc1" -> "lxc-ms_stop_0 lxc2" [ style = bold] +"lxc-ms_demote_0 lxc1" -> "lxc1_stop_0 18node1" [ style = bold] +"lxc-ms_demote_0 lxc1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_demote_0 lxc2" -> "lxc-ms_stop_0 lxc1" [ style = bold] +"lxc-ms_demote_0 lxc2" -> "lxc-ms_stop_0 lxc2" [ style = bold] +"lxc-ms_demote_0 lxc2" -> "lxc2_stop_0 18node1" [ style = bold] +"lxc-ms_demote_0 lxc2" [ style=bold color="green" fontcolor="black"] +"lxc-ms_stop_0 lxc1" -> "all_stopped" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc-ms_delete_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc-ms_delete_0 18node2" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc-ms_delete_0 18node3" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc1_stop_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_stop_0 lxc2" -> "all_stopped" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc-ms_delete_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc-ms_delete_0 18node2" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc-ms_delete_0 18node3" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc2_stop_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc2" [ style=bold color="green" fontcolor="black"] +"lxc1_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc1_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"lxc1_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"lxc1_stop_0 18node1" -> "all_stopped" [ style = bold] +"lxc1_stop_0 18node1" -> "container1_stop_0 18node1" [ style = bold] +"lxc1_stop_0 18node1" -> "lxc1_delete_0 18node1" [ style = bold] +"lxc1_stop_0 18node1" -> "lxc1_delete_0 18node2" [ style = bold] +"lxc1_stop_0 18node1" -> "lxc1_delete_0 18node3" [ style = bold] +"lxc1_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc2_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc2_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"lxc2_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"lxc2_stop_0 18node1" -> "all_stopped" [ style = bold] +"lxc2_stop_0 18node1" -> "container2_stop_0 18node1" [ style = bold] +"lxc2_stop_0 18node1" -> "lxc2_delete_0 18node1" [ style = bold] +"lxc2_stop_0 18node1" -> "lxc2_delete_0 18node2" [ style = bold] +"lxc2_stop_0 18node1" -> "lxc2_delete_0 18node3" [ style = bold] +"lxc2_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/whitebox-orphan-ms.exp b/pengine/test10/whitebox-orphan-ms.exp new file mode 100644 index 0000000..d36a9be --- /dev/null +++ b/pengine/test10/whitebox-orphan-ms.exp @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/whitebox-orphan-ms.pe.dot b/pengine/test10/whitebox-orphan-ms.pe.dot new file mode 100644 index 0000000..81c37eb --- /dev/null +++ b/pengine/test10/whitebox-orphan-ms.pe.dot @@ -0,0 +1,69 @@ +digraph "g" { +"FencingFail_start_0 18node1" [ style=bold color="green" fontcolor="black"] +"FencingFail_stop_0 18node3" -> "FencingFail_start_0 18node1" [ style = bold] +"FencingFail_stop_0 18node3" -> "all_stopped" [ style = bold] +"FencingFail_stop_0 18node3" [ style=bold color="green" fontcolor="black"] +"all_stopped" [ style=bold color="green" fontcolor="orange"] +"container1_delete_0 18node1" -> "container1_start_0 " [ style = dashed] +"container1_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"container1_delete_0 18node2" -> "container1_start_0 " [ style = dashed] +"container1_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"container1_delete_0 18node3" -> "container1_start_0 " [ style = dashed] +"container1_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"container1_start_0 " [ style=dashed color="red" fontcolor="black"] +"container1_stop_0 18node1" -> "all_stopped" [ style = bold] +"container1_stop_0 18node1" -> "container1_delete_0 18node1" [ style = bold] +"container1_stop_0 18node1" -> "container1_delete_0 18node2" [ style = bold] +"container1_stop_0 18node1" -> "container1_delete_0 18node3" [ style = bold] +"container1_stop_0 18node1" -> "container1_start_0 " [ style = dashed] +"container1_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +"container2_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"container2_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"container2_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"container2_stop_0 18node1" -> "all_stopped" [ style = bold] +"container2_stop_0 18node1" -> "container2_delete_0 18node1" [ style = bold] +"container2_stop_0 18node1" -> "container2_delete_0 18node2" [ style = bold] +"container2_stop_0 18node1" -> "container2_delete_0 18node3" [ style = bold] +"container2_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"lxc-ms_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"lxc-ms_demote_0 lxc1" -> "lxc-ms_stop_0 lxc1" [ style = bold] +"lxc-ms_demote_0 lxc1" -> "lxc-ms_stop_0 lxc2" [ style = bold] +"lxc-ms_demote_0 lxc1" -> "lxc1_stop_0 18node1" [ style = bold] +"lxc-ms_demote_0 lxc1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_demote_0 lxc2" -> "lxc-ms_stop_0 lxc1" [ style = bold] +"lxc-ms_demote_0 lxc2" -> "lxc-ms_stop_0 lxc2" [ style = bold] +"lxc-ms_demote_0 lxc2" -> "lxc2_stop_0 18node1" [ style = bold] +"lxc-ms_demote_0 lxc2" [ style=bold color="green" fontcolor="black"] +"lxc-ms_stop_0 lxc1" -> "all_stopped" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc-ms_delete_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc-ms_delete_0 18node2" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc-ms_delete_0 18node3" [ style = bold] +"lxc-ms_stop_0 lxc1" -> "lxc1_stop_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc1" [ style=bold color="green" fontcolor="black"] +"lxc-ms_stop_0 lxc2" -> "all_stopped" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc-ms_delete_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc-ms_delete_0 18node2" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc-ms_delete_0 18node3" [ style = bold] +"lxc-ms_stop_0 lxc2" -> "lxc2_stop_0 18node1" [ style = bold] +"lxc-ms_stop_0 lxc2" [ style=bold color="green" fontcolor="black"] +"lxc1_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc1_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"lxc1_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"lxc1_stop_0 18node1" -> "all_stopped" [ style = bold] +"lxc1_stop_0 18node1" -> "container1_stop_0 18node1" [ style = bold] +"lxc1_stop_0 18node1" -> "lxc1_delete_0 18node1" [ style = bold] +"lxc1_stop_0 18node1" -> "lxc1_delete_0 18node2" [ style = bold] +"lxc1_stop_0 18node1" -> "lxc1_delete_0 18node3" [ style = bold] +"lxc1_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc2_delete_0 18node1" [ style=bold color="green" fontcolor="black"] +"lxc2_delete_0 18node2" [ style=bold color="green" fontcolor="black"] +"lxc2_delete_0 18node3" [ style=bold color="green" fontcolor="black"] +"lxc2_stop_0 18node1" -> "all_stopped" [ style = bold] +"lxc2_stop_0 18node1" -> "container2_stop_0 18node1" [ style = bold] +"lxc2_stop_0 18node1" -> "lxc2_delete_0 18node1" [ style = bold] +"lxc2_stop_0 18node1" -> "lxc2_delete_0 18node2" [ style = bold] +"lxc2_stop_0 18node1" -> "lxc2_delete_0 18node3" [ style = bold] +"lxc2_stop_0 18node1" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/whitebox-orphan-ms.scores b/pengine/test10/whitebox-orphan-ms.scores new file mode 100644 index 0000000..d968052 --- /dev/null +++ b/pengine/test10/whitebox-orphan-ms.scores @@ -0,0 +1,105 @@ +Allocation scores: +clone_color: Connectivity allocation score on 18node1: 0 +clone_color: Connectivity allocation score on 18node2: 0 +clone_color: Connectivity allocation score on 18node3: 0 +clone_color: master-1 allocation score on 18node1: 0 +clone_color: master-1 allocation score on 18node2: 0 +clone_color: master-1 allocation score on 18node3: 0 +clone_color: master-1 allocation score on lxc1: -INFINITY +clone_color: master-1 allocation score on lxc2: -INFINITY +clone_color: ping-1:0 allocation score on 18node1: 1 +clone_color: ping-1:0 allocation score on 18node2: 0 +clone_color: ping-1:0 allocation score on 18node3: 0 +clone_color: ping-1:1 allocation score on 18node1: 0 +clone_color: ping-1:1 allocation score on 18node2: 1 +clone_color: ping-1:1 allocation score on 18node3: 0 +clone_color: ping-1:2 allocation score on 18node1: 0 +clone_color: ping-1:2 allocation score on 18node2: 0 +clone_color: ping-1:2 allocation score on 18node3: 1 +clone_color: stateful-1:0 allocation score on 18node1: 11 +clone_color: stateful-1:0 allocation score on 18node2: 0 +clone_color: stateful-1:0 allocation score on 18node3: 0 +clone_color: stateful-1:0 allocation score on lxc1: -INFINITY +clone_color: stateful-1:0 allocation score on lxc2: -INFINITY +clone_color: stateful-1:1 allocation score on 18node1: 0 +clone_color: stateful-1:1 allocation score on 18node2: 6 +clone_color: stateful-1:1 allocation score on 18node3: 0 +clone_color: stateful-1:1 allocation score on lxc1: -INFINITY +clone_color: stateful-1:1 allocation score on lxc2: -INFINITY +clone_color: stateful-1:2 allocation score on 18node1: 0 +clone_color: stateful-1:2 allocation score on 18node2: 0 +clone_color: stateful-1:2 allocation score on 18node3: 6 +clone_color: stateful-1:2 allocation score on lxc1: -INFINITY +clone_color: stateful-1:2 allocation score on lxc2: -INFINITY +group_color: group-1 allocation score on 18node1: 0 +group_color: group-1 allocation score on 18node2: 0 +group_color: group-1 allocation score on 18node3: 0 +group_color: r192.168.122.87 allocation score on 18node1: 0 +group_color: r192.168.122.87 allocation score on 18node2: 0 +group_color: r192.168.122.87 allocation score on 18node3: 0 +group_color: r192.168.122.88 allocation score on 18node1: 0 +group_color: r192.168.122.88 allocation score on 18node2: 0 +group_color: r192.168.122.88 allocation score on 18node3: 0 +group_color: r192.168.122.89 allocation score on 18node1: 0 +group_color: r192.168.122.89 allocation score on 18node2: 0 +group_color: r192.168.122.89 allocation score on 18node3: 0 +native_color: Fencing allocation score on 18node1: 0 +native_color: Fencing allocation score on 18node2: 0 +native_color: Fencing allocation score on 18node3: 0 +native_color: FencingFail allocation score on 18node1: 0 +native_color: FencingFail allocation score on 18node2: 0 +native_color: FencingFail allocation score on 18node3: 0 +native_color: FencingPass allocation score on 18node1: 0 +native_color: FencingPass allocation score on 18node2: 0 +native_color: FencingPass allocation score on 18node3: 0 +native_color: lsb-dummy allocation score on 18node1: 0 +native_color: lsb-dummy allocation score on 18node2: -INFINITY +native_color: lsb-dummy allocation score on 18node3: -INFINITY +native_color: migrator allocation score on 18node1: 1 +native_color: migrator allocation score on 18node2: 0 +native_color: migrator allocation score on 18node3: 0 +native_color: ping-1:0 allocation score on 18node1: 1 +native_color: ping-1:0 allocation score on 18node2: -INFINITY +native_color: ping-1:0 allocation score on 18node3: -INFINITY +native_color: ping-1:1 allocation score on 18node1: 0 +native_color: ping-1:1 allocation score on 18node2: 1 +native_color: ping-1:1 allocation score on 18node3: 0 +native_color: ping-1:2 allocation score on 18node1: 0 +native_color: ping-1:2 allocation score on 18node2: -INFINITY +native_color: ping-1:2 allocation score on 18node3: 1 +native_color: r192.168.122.87 allocation score on 18node1: 11 +native_color: r192.168.122.87 allocation score on 18node2: -INFINITY +native_color: r192.168.122.87 allocation score on 18node3: -INFINITY +native_color: r192.168.122.88 allocation score on 18node1: 0 +native_color: r192.168.122.88 allocation score on 18node2: -INFINITY +native_color: r192.168.122.88 allocation score on 18node3: -INFINITY +native_color: r192.168.122.89 allocation score on 18node1: 0 +native_color: r192.168.122.89 allocation score on 18node2: -INFINITY +native_color: r192.168.122.89 allocation score on 18node3: -INFINITY +native_color: rsc_18node1 allocation score on 18node1: 100 +native_color: rsc_18node1 allocation score on 18node2: 0 +native_color: rsc_18node1 allocation score on 18node3: 0 +native_color: rsc_18node2 allocation score on 18node1: 0 +native_color: rsc_18node2 allocation score on 18node2: 100 +native_color: rsc_18node2 allocation score on 18node3: 0 +native_color: rsc_18node3 allocation score on 18node1: 0 +native_color: rsc_18node3 allocation score on 18node2: 0 +native_color: rsc_18node3 allocation score on 18node3: 100 +native_color: stateful-1:0 allocation score on 18node1: 11 +native_color: stateful-1:0 allocation score on 18node2: -INFINITY +native_color: stateful-1:0 allocation score on 18node3: -INFINITY +native_color: stateful-1:0 allocation score on lxc1: -INFINITY +native_color: stateful-1:0 allocation score on lxc2: -INFINITY +native_color: stateful-1:1 allocation score on 18node1: 0 +native_color: stateful-1:1 allocation score on 18node2: 6 +native_color: stateful-1:1 allocation score on 18node3: 0 +native_color: stateful-1:1 allocation score on lxc1: -INFINITY +native_color: stateful-1:1 allocation score on lxc2: -INFINITY +native_color: stateful-1:2 allocation score on 18node1: 0 +native_color: stateful-1:2 allocation score on 18node2: -INFINITY +native_color: stateful-1:2 allocation score on 18node3: 6 +native_color: stateful-1:2 allocation score on lxc1: -INFINITY +native_color: stateful-1:2 allocation score on lxc2: -INFINITY +stateful-1:0 promotion score on 18node1: 10 +stateful-1:1 promotion score on 18node2: 5 +stateful-1:2 promotion score on 18node3: 5 diff --git a/pengine/test10/whitebox-orphan-ms.summary b/pengine/test10/whitebox-orphan-ms.summary new file mode 100644 index 0000000..30c6a3b --- /dev/null +++ b/pengine/test10/whitebox-orphan-ms.summary @@ -0,0 +1,85 @@ + +Current cluster status: +Online: [ 18node1 18node2 18node3 ] +Containers: [ lxc1:container1 lxc2:container2 ] + + Fencing (stonith:fence_xvm): Started 18node2 + FencingPass (stonith:fence_dummy): Started 18node3 + FencingFail (stonith:fence_dummy): Started 18node3 + rsc_18node1 (ocf::heartbeat:IPaddr2): Started 18node1 + rsc_18node2 (ocf::heartbeat:IPaddr2): Started 18node2 + rsc_18node3 (ocf::heartbeat:IPaddr2): Started 18node3 + migrator (ocf::pacemaker:Dummy): Started 18node1 + Clone Set: Connectivity [ping-1] + Started: [ 18node1 18node2 18node3 ] + Master/Slave Set: master-1 [stateful-1] + Masters: [ 18node1 ] + Slaves: [ 18node2 18node3 ] + Resource Group: group-1 + r192.168.122.87 (ocf::heartbeat:IPaddr2): Started 18node1 + r192.168.122.88 (ocf::heartbeat:IPaddr2): Started 18node1 + r192.168.122.89 (ocf::heartbeat:IPaddr2): Started 18node1 + lsb-dummy (lsb:/usr/share/pacemaker/tests/cts/LSBDummy): Started 18node1 + container2 (ocf::heartbeat:VirtualDomain): ORPHANED Started 18node1 + lxc1 (ocf::pacemaker:remote): ORPHANED Started 18node1 + lxc-ms (ocf::pacemaker:Stateful): ORPHANED Master [ lxc1 lxc2 ] + lxc2 (ocf::pacemaker:remote): ORPHANED Started 18node1 + container1 (ocf::heartbeat:VirtualDomain): ORPHANED Started 18node1 + +Transition Summary: + * Move FencingFail (Started 18node3 -> 18node1) + * Stop container2 (18node1) + * Stop lxc1 (18node1) + * Demote lxc-ms (Master -> Stopped lxc1) + * Stop lxc2 (18node1) + * Stop container1 (18node1) + +Executing cluster transition: + * Resource action: FencingFail stop on 18node3 + * Resource action: lxc-ms demote on lxc2 + * Resource action: lxc-ms demote on lxc1 + * Resource action: FencingFail start on 18node1 + * Resource action: lxc-ms stop on lxc2 + * Resource action: lxc-ms stop on lxc1 + * Resource action: lxc-ms delete on 18node3 + * Resource action: lxc-ms delete on 18node2 + * Resource action: lxc-ms delete on 18node1 + * Resource action: lxc2 stop on 18node1 + * Resource action: lxc2 delete on 18node3 + * Resource action: lxc2 delete on 18node2 + * Resource action: lxc2 delete on 18node1 + * Resource action: container2 stop on 18node1 + * Resource action: container2 delete on 18node3 + * Resource action: container2 delete on 18node2 + * Resource action: container2 delete on 18node1 + * Resource action: lxc1 stop on 18node1 + * Resource action: lxc1 delete on 18node3 + * Resource action: lxc1 delete on 18node2 + * Resource action: lxc1 delete on 18node1 + * Resource action: container1 stop on 18node1 + * Resource action: container1 delete on 18node3 + * Resource action: container1 delete on 18node2 + * Resource action: container1 delete on 18node1 + * Pseudo action: all_stopped + +Revised cluster status: +Online: [ 18node1 18node2 18node3 ] + + Fencing (stonith:fence_xvm): Started 18node2 + FencingPass (stonith:fence_dummy): Started 18node3 + FencingFail (stonith:fence_dummy): Started 18node1 + rsc_18node1 (ocf::heartbeat:IPaddr2): Started 18node1 + rsc_18node2 (ocf::heartbeat:IPaddr2): Started 18node2 + rsc_18node3 (ocf::heartbeat:IPaddr2): Started 18node3 + migrator (ocf::pacemaker:Dummy): Started 18node1 + Clone Set: Connectivity [ping-1] + Started: [ 18node1 18node2 18node3 ] + Master/Slave Set: master-1 [stateful-1] + Masters: [ 18node1 ] + Slaves: [ 18node2 18node3 ] + Resource Group: group-1 + r192.168.122.87 (ocf::heartbeat:IPaddr2): Started 18node1 + r192.168.122.88 (ocf::heartbeat:IPaddr2): Started 18node1 + r192.168.122.89 (ocf::heartbeat:IPaddr2): Started 18node1 + lsb-dummy (lsb:/usr/share/pacemaker/tests/cts/LSBDummy): Started 18node1 + diff --git a/pengine/test10/whitebox-orphan-ms.xml b/pengine/test10/whitebox-orphan-ms.xml new file mode 100644 index 0000000..c9a62fa --- /dev/null +++ b/pengine/test10/whitebox-orphan-ms.xml @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/whitebox-start.exp b/pengine/test10/whitebox-start.exp index 4dcfdc4..19cae49 100644 --- a/pengine/test10/whitebox-start.exp +++ b/pengine/test10/whitebox-start.exp @@ -67,7 +67,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/pengine/test10/whitebox-stop.exp b/pengine/test10/whitebox-stop.exp index 643c94c..7720235 100644 --- a/pengine/test10/whitebox-stop.exp +++ b/pengine/test10/whitebox-stop.exp @@ -87,7 +87,7 @@ - +