12 #include <sys/param.h> 65 if ((lh_rsc != NULL) && (rh_action != NULL) && (
data_set != NULL)) {
67 rh_action->
rsc, NULL, rh_action,
77 if ((lh_action != NULL) && (rh_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)
170 return (interval_ms > 0);
186 if (
action->rsc == NULL) {
192 remote_rsc =
action->node->details->remote_rsc;
195 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
198 remote_rsc->
id, state2text(state));
219 order_start_then_action(remote_rsc,
action, order_opts,
data_set);
224 order_action_then_stop(
action, remote_rsc,
235 "resources are active but connection is unrecoverable",
243 order_action_then_stop(
action, remote_rsc,
270 if (is_recurring_action(
action)) {
275 order_start_then_action(remote_rsc,
action,
279 pe_node_t *cluster_node = pe__current_node(remote_rsc);
287 "resources are in unknown state " 288 "and connection is unrecoverable", FALSE);
296 order_action_then_stop(
action, remote_rsc,
326 remote_rsc =
action->node->details->remote_rsc;
336 crm_trace(
"Order %s action %s relative to %s%s for %s%s",
388 if (is_recurring_action(
action)) {
394 order_start_then_action(remote_rsc,
action,
418 crm_trace(
"Creating remote connection orderings");
420 for (GList *gIter =
data_set->
actions; gIter != NULL; gIter = gIter->next) {
425 if (
action->rsc == NULL) {
433 if (
action->rsc->is_remote_node &&
444 if (
action->node == NULL) {
462 remote =
action->node->details->remote_rsc;
463 if (remote == NULL) {
474 for (GList *item =
action->rsc->actions; item != NULL;
481 action->rsc, NULL, rsc_action,
496 if (remote->container) {
535 return (rsc != NULL) && (rsc->
fillers != NULL) && (node != NULL)
559 bool partial_migration =
false;
560 const char *task =
action->task;
569 began_on = pe__current_node(
action->node->details->remote_rsc);
570 ended_on =
action->node->details->remote_rsc->allocated_to;
571 if (
action->node->details->remote_rsc
572 && (
action->node->details->remote_rsc->container == NULL)
573 &&
action->node->details->remote_rsc->partial_migration_target) {
574 partial_migration =
true;
577 if (began_on == NULL) {
578 crm_trace(
"Routing %s for %s through remote connection's " 579 "next node %s (starting)%s",
582 partial_migration?
" (partial migration)" :
"");
586 if (ended_on == NULL) {
587 crm_trace(
"Routing %s for %s through remote connection's " 588 "current node %s (stopping)%s",
591 partial_migration?
" (partial migration)" :
"");
596 crm_trace(
"Routing %s for %s through remote connection's " 597 "current node %s (not moving)%s",
600 partial_migration?
" (partial migration)" :
"");
612 task = g_hash_table_lookup(
action->meta,
"notify_operation");
628 "migrate_to", NULL) && !partial_migration) {
629 crm_trace(
"Routing %s for %s through remote connection's " 630 "current node %s (moving)%s",
633 partial_migration?
" (partial migration)" :
"");
641 crm_trace(
"Routing %s for %s through remote connection's " 642 "next node %s (moving)%s",
645 partial_migration?
" (partial migration)" :
"");
666 const char *remote_addr = g_hash_table_lookup(params,
673 if (remote_addr != NULL) {
675 strdup(remote_addr));
703 task =
text2task(g_hash_table_lookup(
action->meta,
"notify_operation"));
712 host = pe__current_node(
action->node->details->remote_rsc->container);
721 host =
action->node->details->remote_rsc->container->allocated_to;
730 (gpointer) g_hash_table_lookup(
action->rsc->meta,
732 (gpointer) args_xml);
734 (gpointer)
host->details->uname,
735 (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
G_GNUC_INTERNAL void pcmk__new_ordering(pe_resource_t *lh_rsc, char *lh_task, pe_action_t *lh_action, pe_resource_t *rh_rsc, char *rh_task, pe_action_t *rh_action, enum pe_ordering type, pe_working_set_t *data_set)
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
int pcmk__guint_from_hash(GHashTable *table, const char *key, guint default_val, guint *result)
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)
GHashTable * pe_rsc_params(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
pe_working_set_t * data_set
Wrappers for and extensions to libxml2.
bool pcmk__is_failed_remote_node(pe_node_t *node)
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.
#define XML_LRM_ATTR_INTERVAL_MS
#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 *data_set)
#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.