12 #include <sys/param.h> 64 if ((first_rsc != NULL) && (then_action != NULL)) {
66 then_action->
rsc, NULL, then_action,
78 if ((first_action != NULL) && (then_rsc != NULL)) {
96 cluster_node = pcmk__current_node(remote_rsc);
138 }
else if (cluster_node == NULL) {
149 }
else if (pcmk__list_of_multiple(remote_rsc->
running_on)
176 if (
action->rsc == NULL) {
182 remote_rsc =
action->node->details->remote_rsc;
185 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
188 remote_rsc->
id, state2text(state));
210 order_start_then_action(remote_rsc,
action, order_opts);
215 order_action_then_stop(
action, remote_rsc,
226 "resources are active but " 227 "connection is unrecoverable",
235 order_action_then_stop(
action, remote_rsc,
265 order_start_then_action(remote_rsc,
action,
269 pcmk_node_t *cluster_node = pcmk__current_node(remote_rsc);
277 "resources are in unknown state " 278 "and connection is unrecoverable", FALSE);
286 order_action_then_stop(
action, remote_rsc,
315 remote_rsc =
action->node->details->remote_rsc;
326 crm_trace(
"Order %s action %s relative to %s%s for %s%s",
345 order_start_then_action(container,
action,
382 order_start_then_action(remote_rsc,
action,
405 crm_trace(
"Creating remote connection orderings");
412 if (
action->rsc == NULL) {
420 if (
action->rsc->is_remote_node &&
433 if (
action->node == NULL) {
437 if (!pcmk__is_pacemaker_remote_node(
action->node)) {
451 remote =
action->node->details->remote_rsc;
452 if (remote == NULL) {
463 for (GList *item =
action->rsc->actions; item != NULL;
467 if (!pcmk__same_node(rsc_action->
node,
action->node)
471 action->rsc, NULL, rsc_action,
488 apply_container_ordering(
action);
492 apply_remote_ordering(
action);
526 return (rsc != NULL) && (rsc->
fillers != NULL) && (node != NULL)
550 bool partial_migration =
false;
551 const char *task =
action->task;
554 || !pcmk__is_pacemaker_remote_node(
action->node)) {
560 began_on = pcmk__current_node(
action->node->details->remote_rsc);
561 ended_on =
action->node->details->remote_rsc->allocated_to;
562 if (
action->node->details->remote_rsc
563 && (
action->node->details->remote_rsc->container == NULL)
564 &&
action->node->details->remote_rsc->partial_migration_target) {
565 partial_migration =
true;
568 if (began_on == NULL) {
569 crm_trace(
"Routing %s for %s through remote connection's " 570 "next node %s (starting)%s",
573 partial_migration?
" (partial migration)" :
"");
577 if (ended_on == NULL) {
578 crm_trace(
"Routing %s for %s through remote connection's " 579 "current node %s (stopping)%s",
582 partial_migration?
" (partial migration)" :
"");
586 if (pcmk__same_node(began_on, ended_on)) {
587 crm_trace(
"Routing %s for %s through remote connection's " 588 "current node %s (not moving)%s",
591 partial_migration?
" (partial migration)" :
"");
603 task = g_hash_table_lookup(
action->meta,
"notify_operation");
621 && !partial_migration) {
622 crm_trace(
"Routing %s for %s through remote connection's " 623 "current node %s (moving)%s",
626 partial_migration?
" (partial migration)" :
"");
634 crm_trace(
"Routing %s for %s through remote connection's " 635 "next node %s (moving)%s",
638 partial_migration?
" (partial migration)" :
"");
663 if (remote_addr != NULL) {
691 if (!pcmk__is_guest_or_bundle_node(guest)) {
698 "notify_operation"));
725 g_hash_table_lookup(
action->rsc->meta,
730 (gpointer) args_xml);
732 (gpointer)
host->details->uname,
733 (gpointer) args_xml);
bool pe__shutdown_requested(const pcmk_node_t *node)
'then' is runnable (and migratable) only if 'first' is runnable
pcmk_scheduler_t * cluster
enum action_tasks pcmk_parse_action(const char *action_name)
Parse an action type from an action name.
pcmk_node_t * partial_migration_target
G_GNUC_INTERNAL void pcmk__new_ordering(pcmk_resource_t *first_rsc, char *first_task, pcmk_action_t *first_action, pcmk_resource_t *then_rsc, char *then_task, pcmk_action_t *then_action, uint32_t flags, pcmk_scheduler_t *sched)
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
#define PCMK_META_CONTAINER_ATTRIBUTE_TARGET
enum rsc_role_e next_role
#define PCMK_REMOTE_RA_ADDR
#define PCMK_ACTION_MIGRATE_TO
void pe_fence_node(pcmk_scheduler_t *scheduler, pcmk_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
pcmk_node_t * pcmk__connection_host_for_action(const pcmk_action_t *action)
#define PCMK_ACTION_CLEAR_FAILCOUNT
G_GNUC_INTERNAL bool pcmk__action_is_recurring(const pcmk_action_t *action)
pcmk_resource_t * container
gboolean remote_was_fenced
Ordering applies even if 'first' runs on guest node created by 'then'.
#define pcmk__set_relation_flags(ar_flags, flags_to_set)
#define PCMK_ACTION_DEMOTE
guint remote_reconnect_ms
Actions are ordered (optionally, if no other flags are set)
#define crm_trace(fmt, args...)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
#define PCMK_ACTION_START
Wrappers for and extensions to libxml2.
#define PCMK__META_PHYSICAL_HOST
#define PCMK_ACTION_STONITH
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define PCMK_ACTION_CANCEL
void pcmk__substitute_remote_addr(pcmk_resource_t *rsc, GHashTable *params)
void pcmk__add_guest_meta_to_xml(xmlNode *args_xml, const pcmk_action_t *action)
Add special guest node meta-attributes to XML.
#define pcmk__assert(expr)
void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler)
Cluster status and scheduling.
pcmk_scheduler_t * scheduler
#define PCMK_ACTION_MIGRATE_FROM
bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
pcmk_node_t * allocated_to
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry, as meta-attribute name.
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
void pcmk__insert_dup(GHashTable *table, const char *name, const char *value)
bool pcmk__rsc_corresponds_to_guest(const pcmk_resource_t *rsc, const pcmk_node_t *node)
pcmk_resource_t * remote_rsc
pcmk_node_t * partial_migration_source
#define PCMK_ACTION_NOTIFY
No relation (compare with equality rather than bit set)