12 #include <sys/param.h> 65 if ((first_rsc != NULL) && (then_action != NULL) && (
data_set != NULL)) {
67 then_action->
rsc, NULL, then_action,
77 if ((first_action != NULL) && (then_rsc != NULL) && (
data_set != NULL)) {
85 get_remote_node_state(
const pe_node_t *node)
95 cluster_node = pe__current_node(remote_rsc);
137 }
else if (cluster_node == NULL) {
148 }
else if (pcmk__list_of_multiple(remote_rsc->
running_on)
175 if (
action->rsc == NULL) {
181 remote_rsc =
action->node->details->remote_rsc;
184 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
187 remote_rsc->
id, state2text(state));
208 order_start_then_action(remote_rsc,
action, order_opts,
214 order_action_then_stop(
action, remote_rsc,
226 "resources are active but connection is unrecoverable",
234 order_action_then_stop(
action, remote_rsc,
267 order_start_then_action(remote_rsc,
action,
272 pe_node_t *cluster_node = pe__current_node(remote_rsc);
280 "resources are in unknown state " 281 "and connection is unrecoverable", FALSE);
289 order_action_then_stop(
action, remote_rsc,
320 remote_rsc =
action->node->details->remote_rsc;
330 crm_trace(
"Order %s action %s relative to %s%s for %s%s",
388 order_start_then_action(remote_rsc,
action,
412 crm_trace(
"Creating remote connection orderings");
414 for (GList *gIter =
data_set->
actions; gIter != NULL; gIter = gIter->next) {
419 if (
action->rsc == NULL) {
427 if (
action->rsc->is_remote_node &&
438 if (
action->node == NULL) {
456 remote =
action->node->details->remote_rsc;
457 if (remote == NULL) {
468 for (GList *item =
action->rsc->actions; item != NULL;
475 action->rsc, NULL, rsc_action,
490 if (remote->container) {
496 apply_remote_ordering(
action);
529 return (rsc != NULL) && (rsc->
fillers != NULL) && (node != NULL)
553 bool partial_migration =
false;
554 const char *task =
action->task;
563 began_on = pe__current_node(
action->node->details->remote_rsc);
564 ended_on =
action->node->details->remote_rsc->allocated_to;
565 if (
action->node->details->remote_rsc
566 && (
action->node->details->remote_rsc->container == NULL)
567 &&
action->node->details->remote_rsc->partial_migration_target) {
568 partial_migration =
true;
571 if (began_on == NULL) {
572 crm_trace(
"Routing %s for %s through remote connection's " 573 "next node %s (starting)%s",
576 partial_migration?
" (partial migration)" :
"");
580 if (ended_on == NULL) {
581 crm_trace(
"Routing %s for %s through remote connection's " 582 "current node %s (stopping)%s",
585 partial_migration?
" (partial migration)" :
"");
590 crm_trace(
"Routing %s for %s through remote connection's " 591 "current node %s (not moving)%s",
594 partial_migration?
" (partial migration)" :
"");
606 task = g_hash_table_lookup(
action->meta,
"notify_operation");
622 "migrate_to", NULL) && !partial_migration) {
623 crm_trace(
"Routing %s for %s through remote connection's " 624 "current node %s (moving)%s",
627 partial_migration?
" (partial migration)" :
"");
635 crm_trace(
"Routing %s for %s through remote connection's " 636 "next node %s (moving)%s",
639 partial_migration?
" (partial migration)" :
"");
658 const char *remote_addr = g_hash_table_lookup(params,
665 if (remote_addr != NULL) {
667 strdup(remote_addr));
695 task =
text2task(g_hash_table_lookup(
action->meta,
"notify_operation"));
704 host = pe__current_node(
action->node->details->remote_rsc->container);
713 host =
action->node->details->remote_rsc->container->allocated_to;
722 (gpointer) g_hash_table_lookup(
action->rsc->meta,
724 (gpointer) args_xml);
726 (gpointer)
host->details->uname,
727 (gpointer) args_xml);
bool pcmk__is_failed_remote_node(const pe_node_t *node)
#define CRMD_ACTION_MIGRATED
bool pe__is_guest_or_remote_node(const pe_node_t *node)
void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, const pe_action_t *action)
Add special bundle meta-attributes to XML.
pe_node_t * pcmk__connection_host_for_action(const pe_action_t *action)
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
pe_node_t * partial_migration_source
enum rsc_role_e next_role
pe_resource_t * remote_rsc
bool pcmk__rsc_corresponds_to_guest(const pe_resource_t *rsc, const pe_node_t *node)
enum action_tasks text2task(const char *task)
pe_node_t * partial_migration_target
gboolean remote_was_fenced
#define XML_RSC_ATTR_TARGET
#define XML_RSC_ATTR_REMOTE_RA_ADDR
bool pe__shutdown_requested(const pe_node_t *node)
void pcmk__order_remote_connection_actions(pe_working_set_t *data_set)
bool pe__is_remote_node(const pe_node_t *node)
#define CRM_OP_CLEAR_FAILCOUNT
#define pe_flag_have_remote_nodes
guint remote_reconnect_ms
bool pe__is_guest_node(const pe_node_t *node)
#define crm_trace(fmt, args...)
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
pe_working_set_t * data_set
Wrappers for and extensions to libxml2.
G_GNUC_INTERNAL void pcmk__new_ordering(pe_resource_t *first_rsc, char *first_task, pe_action_t *first_action, pe_resource_t *then_rsc, char *then_task, pe_action_t *then_action, uint32_t flags, pe_working_set_t *data_set)
G_GNUC_INTERNAL bool pcmk__action_is_recurring(const pe_action_t *action)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
Cluster status and scheduling.
GHashTable * pe_rsc_params(pe_resource_t *rsc, const pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
#define CRMD_ACTION_MIGRATE
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry, as meta-attribute name.
void pcmk__substitute_remote_addr(pe_resource_t *rsc, GHashTable *params)
pe_working_set_t * cluster
#define pe__set_order_flags(order_flags, flags_to_set)
#define PCMK__ENV_PHYSICAL_HOST