pacemaker 2.1.1-77db578727
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pcmki_sched_utils.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2021 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#ifndef PENGINE_AUTILS__H
11# define PENGINE_AUTILS__H
12
13#include <stdbool.h> // bool
14#include <glib.h> // GList, GHashTable, gboolean, guint
15#include <crm/lrmd.h> // lrmd_event_data_t
16#include <crm/cib.h> // cib_t
20
21/* Constraint helper functions */
23
25
26pe__location_t *rsc2node_new(const char *id, pe_resource_t *rsc, int weight,
27 const char *discovery_mode, pe_node_t *node,
28 pe_working_set_t *data_set);
29
30void pcmk__new_colocation(const char *id, const char *node_attr, int score,
31 pe_resource_t *rsc_lh, pe_resource_t *rsc_rh,
32 const char *state_lh, const char *state_rh,
33 bool influence, pe_working_set_t *data_set);
34
35extern gboolean rsc_ticket_new(const char *id, pe_resource_t * rsc_lh, pe_ticket_t * ticket,
36 const char *state_lh, const char *loss_policy,
37 pe_working_set_t * data_set);
38
39GHashTable *pcmk__copy_node_table(GHashTable *nodes);
40GList *pcmk__copy_node_list(const GList *list, bool reset);
41GList *sort_nodes_by_weight(GList *nodes, pe_node_t *active_node,
42 pe_working_set_t *data_set);
43
44extern gboolean can_run_resources(const pe_node_t * node);
45extern gboolean native_assign_node(pe_resource_t *rsc, pe_node_t *chosen,
46 gboolean force);
48
49extern void log_action(unsigned int log_level, const char *pre_text,
50 pe_action_t * action, gboolean details);
51
52gboolean can_run_any(GHashTable * nodes);
54 pe_resource_t *rsc, enum rsc_role_e filter,
55 gboolean current,
56 pe_working_set_t *data_set);
58 enum rsc_role_e filter, gboolean current);
59gboolean is_child_compatible(pe_resource_t *child_rsc, pe_node_t * local_node, enum rsc_role_e filter, gboolean current);
60bool assign_node(pe_resource_t * rsc, pe_node_t * node, gboolean force);
61enum pe_action_flags summary_action_flags(pe_action_t * action, GList *children, pe_node_t * node);
64
70
71extern enum filter_colocation_res
73 pcmk__colocation_t *constraint, gboolean preview);
74
75extern int compare_capacity(const pe_node_t * node1, const pe_node_t * node2);
76extern void calculate_utilization(GHashTable * current_utilization,
77 GHashTable * utilization, gboolean plus);
78
79extern void process_utilization(pe_resource_t * rsc, pe_node_t ** prefer, pe_working_set_t * data_set);
80pe_action_t *create_pseudo_resource_op(pe_resource_t * rsc, const char *task, bool optional, bool runnable, pe_working_set_t *data_set);
82 guint interval_ms, pe_node_t *node,
83 pe_working_set_t *data_set);
85
86xmlNode *pcmk__create_history_xml(xmlNode *parent, lrmd_event_data_t *event,
87 const char *caller_version, int target_rc,
88 const char *node, const char *origin,
89 int level);
90
91# define LOAD_STOPPED "load_stopped"
92
94 pe_working_set_t * data_set, cib_t *cib,
95 const char *quorum, const char *watchdog, GList *node_up, GList *node_down, GList *node_fail,
96 GList *op_inject, GList *ticket_grant, GList *ticket_revoke,
97 GList *ticket_standby, GList *ticket_activate);
98
99int run_simulation(pe_working_set_t * data_set, cib_t *cib, GList *op_fail_list);
100
102
103#endif
Cluster Configuration.
action_tasks
Definition common.h:62
rsc_role_e
Possible roles that a resource can be in.
Definition common.h:92
Resource agent executor.
char * name
Definition pcmk_fence.c:31
const char * action
Definition pcmk_fence.c:30
bool assign_node(pe_resource_t *rsc, pe_node_t *node, gboolean force)
pcmk__output_t * pcmk__new_logger(void)
GHashTable * pcmk__copy_node_table(GHashTable *nodes)
gboolean rsc_ticket_new(const char *id, pe_resource_t *rsc_lh, pe_ticket_t *ticket, const char *state_lh, const char *loss_policy, pe_working_set_t *data_set)
xmlNode * pcmk__create_history_xml(xmlNode *parent, lrmd_event_data_t *event, const char *caller_version, int target_rc, const char *node, const char *origin, int level)
pe__location_t * copy_constraint(pe__location_t *constraint)
int compare_capacity(const pe_node_t *node1, const pe_node_t *node2)
gboolean can_run_resources(const pe_node_t *node)
pe_resource_t * find_compatible_child(pe_resource_t *local_child, pe_resource_t *rsc, enum rsc_role_e filter, gboolean current, pe_working_set_t *data_set)
GList * pcmk__copy_node_list(const GList *list, bool reset)
gboolean is_child_compatible(pe_resource_t *child_rsc, pe_node_t *local_node, enum rsc_role_e filter, gboolean current)
void native_deallocate(pe_resource_t *rsc)
pe_action_t * pe_cancel_op(pe_resource_t *rsc, const char *name, guint interval_ms, pe_node_t *node, pe_working_set_t *data_set)
void calculate_utilization(GHashTable *current_utilization, GHashTable *utilization, gboolean plus)
gboolean can_run_any(GHashTable *nodes)
int run_simulation(pe_working_set_t *data_set, cib_t *cib, GList *op_fail_list)
void log_action(unsigned int log_level, const char *pre_text, pe_action_t *action, gboolean details)
pe__location_t * rsc2node_new(const char *id, pe_resource_t *rsc, int weight, const char *discovery_mode, pe_node_t *node, pe_working_set_t *data_set)
pe_action_t * create_pseudo_resource_op(pe_resource_t *rsc, const char *task, bool optional, bool runnable, pe_working_set_t *data_set)
void pcmk__new_colocation(const char *id, const char *node_attr, int score, pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, const char *state_lh, const char *state_rh, bool influence, pe_working_set_t *data_set)
void process_utilization(pe_resource_t *rsc, pe_node_t **prefer, pe_working_set_t *data_set)
void modify_configuration(pe_working_set_t *data_set, cib_t *cib, const char *quorum, const char *watchdog, GList *node_up, GList *node_down, GList *node_fail, GList *op_inject, GList *ticket_grant, GList *ticket_revoke, GList *ticket_standby, GList *ticket_activate)
pe_action_t * sched_shutdown_op(pe_node_t *node, pe_working_set_t *data_set)
enum filter_colocation_res filter_colocation_constraint(pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, pcmk__colocation_t *constraint, gboolean preview)
pcmk__colocation_t * invert_constraint(pcmk__colocation_t *constraint)
filter_colocation_res
@ influence_rsc_priority
@ influence_rsc_location
@ influence_nothing
enum action_tasks clone_child_action(pe_action_t *action)
pe_resource_t * find_compatible_child_by_node(pe_resource_t *local_child, pe_node_t *local_node, pe_resource_t *rsc, enum rsc_role_e filter, gboolean current)
int copies_per_node(pe_resource_t *rsc)
GList * sort_nodes_by_weight(GList *nodes, pe_node_t *active_node, pe_working_set_t *data_set)
enum pe_action_flags summary_action_flags(pe_action_t *action, GList *children, pe_node_t *node)
gboolean native_assign_node(pe_resource_t *rsc, pe_node_t *chosen, gboolean force)
Data types for cluster status.
pe_action_flags
Definition pe_types.h:291
This structure contains everything that makes up a single output formatter.