12 #include <sys/param.h> 65 if ((first_rsc != NULL) && (then_action != NULL)) {
67 then_action->
rsc, NULL, then_action,
79 if ((first_action != NULL) && (then_rsc != NULL)) {
97 cluster_node = pe__current_node(remote_rsc);
139 }
else if (cluster_node == NULL) {
150 }
else if (pcmk__list_of_multiple(remote_rsc->
running_on)
177 if (
action->rsc == NULL) {
183 remote_rsc =
action->node->details->remote_rsc;
186 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
189 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 = pe__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) {
451 remote =
action->node->details->remote_rsc;
452 if (remote == NULL) {
463 for (GList *item =
action->rsc->actions; item != NULL;
467 if (!pe__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;
560 began_on = pe__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 (pe__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)" :
"");
657 const char *remote_addr = g_hash_table_lookup(params,
664 if (remote_addr != NULL) {
666 strdup(remote_addr));
695 task =
text2task(g_hash_table_lookup(
action->meta,
"notify_operation"));
722 (gpointer) g_hash_table_lookup(
action->rsc->meta,
724 (gpointer) args_xml);
726 (gpointer)
host->details->uname,
727 (gpointer) args_xml);
bool pe__shutdown_requested(const pcmk_node_t *node)
'then' is runnable (and migratable) only if 'first' is runnable
bool pe__is_guest_or_remote_node(const pcmk_node_t *node)
pcmk_scheduler_t * cluster
Cluster that resource is part of.
pcmk_node_t * partial_migration_target
The destination node, if migrate_to completed but migrate_from has not.
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
enum rsc_role_e next_role
Resource's scheduled next role.
Implementation of pcmk_action_t.
void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, const pcmk_action_t *action)
Add special bundle meta-attributes to XML.
#define PCMK_ACTION_MIGRATE_TO
action_tasks
Possible actions (including some pseudo-actions)
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.
enum action_tasks text2task(const char *task)
pcmk_node_t * pcmk__connection_host_for_action(const pcmk_action_t *action)
GList * actions
Scheduled actions.
#define PCMK_ACTION_CLEAR_FAILCOUNT
G_GNUC_INTERNAL bool pcmk__action_is_recurring(const pcmk_action_t *action)
pcmk_resource_t * container
Resource containing this one, if any.
gboolean remote_was_fenced
Implementation of pcmk_scheduler_t.
#define XML_RSC_ATTR_TARGET
Ordering applies even if 'first' runs on guest node created by 'then'.
#define XML_RSC_ATTR_REMOTE_RA_ADDR
#define PCMK_ACTION_DEMOTE
guint remote_reconnect_ms
Retry interval for remote connections.
pcmk_node_t * node
Node to execute action on, if any.
Implementation of pcmk_resource_t.
Actions are ordered (optionally, if no other flags are set)
Whether the cluster includes any Pacemaker Remote nodes (via CIB)
Whether resource is considered failed.
#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
Basic node information.
#define PCMK_ACTION_START
unsigned long long flags
Group of enum pcmk_rsc_flags.
const char * uname
Node name in cluster.
Wrappers for and extensions to libxml2.
#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)
Implementation of pcmk_node_t.
#define PCMK_ACTION_CANCEL
void pcmk__substitute_remote_addr(pcmk_resource_t *rsc, GHashTable *params)
GList * fillers
Resources contained by this one, if any.
Unspecified or unknown action.
void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler)
bool pe__is_guest_node(const pcmk_node_t *node)
Cluster status and scheduling.
pcmk_scheduler_t * scheduler
Whether action does not require invoking an agent.
#define PCMK_ACTION_MIGRATE_FROM
bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
pcmk_node_t * allocated_to
Node resource is assigned to.
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry, as meta-attribute name.
bool pe__is_remote_node(const pcmk_node_t *node)
GList * running_on
Nodes where resource may be active.
pcmk_resource_t * rsc
Resource to apply action to, if any.
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
#define pe__set_order_flags(order_flags, flags_to_set)
unsigned long long flags
Group of enum pcmk_scheduler_flags.
#define PCMK__ENV_PHYSICAL_HOST
gboolean unclean
Whether node requires fencing.
bool pcmk__rsc_corresponds_to_guest(const pcmk_resource_t *rsc, const pcmk_node_t *node)
gboolean online
Whether online.
pcmk_resource_t * remote_rsc
Remote connection resource for node, if it is a Pacemaker Remote node.
pcmk_node_t * partial_migration_source
The source node, if migrate_to completed but migrate_from has not.
#define PCMK_ACTION_NOTIFY
No relation (compare with equality rather than bit set)
char * id
Resource ID in configuration.