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)) {
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)
173 if (
action->rsc == NULL) {
179 remote_rsc =
action->node->details->remote_rsc;
182 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
185 remote_rsc->
id, state2text(state));
206 order_start_then_action(remote_rsc,
action, order_opts,
data_set);
211 order_action_then_stop(
action, remote_rsc,
222 "resources are active but connection is unrecoverable",
230 order_action_then_stop(
action, remote_rsc,
262 order_start_then_action(remote_rsc,
action,
266 pe_node_t *cluster_node = pe__current_node(remote_rsc);
274 "resources are in unknown state " 275 "and connection is unrecoverable", FALSE);
283 order_action_then_stop(
action, remote_rsc,
313 remote_rsc =
action->node->details->remote_rsc;
323 crm_trace(
"Order %s action %s relative to %s%s for %s%s",
381 order_start_then_action(remote_rsc,
action,
405 crm_trace(
"Creating remote connection orderings");
407 for (GList *gIter =
data_set->
actions; gIter != NULL; gIter = gIter->next) {
412 if (
action->rsc == NULL) {
420 if (
action->rsc->is_remote_node &&
431 if (
action->node == NULL) {
449 remote =
action->node->details->remote_rsc;
450 if (remote == NULL) {
461 for (GList *item =
action->rsc->actions; item != NULL;
468 action->rsc, NULL, rsc_action,
483 if (remote->container) {
522 return (rsc != NULL) && (rsc->
fillers != NULL) && (node != NULL)
546 bool partial_migration =
false;
547 const char *task =
action->task;
556 began_on = pe__current_node(
action->node->details->remote_rsc);
557 ended_on =
action->node->details->remote_rsc->allocated_to;
558 if (
action->node->details->remote_rsc
559 && (
action->node->details->remote_rsc->container == NULL)
560 &&
action->node->details->remote_rsc->partial_migration_target) {
561 partial_migration =
true;
564 if (began_on == NULL) {
565 crm_trace(
"Routing %s for %s through remote connection's " 566 "next node %s (starting)%s",
569 partial_migration?
" (partial migration)" :
"");
573 if (ended_on == NULL) {
574 crm_trace(
"Routing %s for %s through remote connection's " 575 "current node %s (stopping)%s",
578 partial_migration?
" (partial migration)" :
"");
583 crm_trace(
"Routing %s for %s through remote connection's " 584 "current node %s (not moving)%s",
587 partial_migration?
" (partial migration)" :
"");
599 task = g_hash_table_lookup(
action->meta,
"notify_operation");
615 "migrate_to", NULL) && !partial_migration) {
616 crm_trace(
"Routing %s for %s through remote connection's " 617 "current node %s (moving)%s",
620 partial_migration?
" (partial migration)" :
"");
628 crm_trace(
"Routing %s for %s through remote connection's " 629 "next node %s (moving)%s",
632 partial_migration?
" (partial migration)" :
"");
651 const char *remote_addr = g_hash_table_lookup(params,
658 if (remote_addr != NULL) {
660 strdup(remote_addr));
688 task =
text2task(g_hash_table_lookup(
action->meta,
"notify_operation"));
697 host = pe__current_node(
action->node->details->remote_rsc->container);
706 host =
action->node->details->remote_rsc->container->allocated_to;
715 (gpointer) g_hash_table_lookup(
action->rsc->meta,
717 (gpointer) args_xml);
719 (gpointer)
host->details->uname,
720 (gpointer) args_xml);
#define CRMD_ACTION_MIGRATED
bool pe__is_guest_or_remote_node(const pe_node_t *node)
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
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
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
bool pe__shutdown_requested(pe_node_t *node)
pe_node_t * pcmk__connection_host_for_action(pe_action_t *action)
pe_working_set_t * data_set
Wrappers for and extensions to libxml2.
bool pcmk__is_failed_remote_node(pe_node_t *node)
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)
bool pcmk__rsc_corresponds_to_guest(pe_resource_t *rsc, pe_node_t *node)
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
void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, pe_action_t *action)
Add special bundle meta-attributes to XML.