root/include/pcmki/pcmki_scheduler.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2014-2020 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__H
  11 #  define PENGINE__H
  12 
  13 typedef struct rsc_colocation_s rsc_colocation_t;
  14 typedef struct rsc_ticket_s rsc_ticket_t;
  15 typedef struct lrm_agent_s lrm_agent_t;
  16 
  17 #  include <glib.h>
  18 #  include <crm/crm.h>
  19 #  include <crm/common/iso8601.h>
  20 #  include <crm/pengine/rules.h>
  21 #  include <crm/pengine/common.h>
  22 #  include <crm/pengine/status.h>
  23 
  24 #  include <crm/pengine/complex.h>
  25 
  26 enum pe_stop_fail {
  27     pesf_block,
  28     pesf_stonith,
  29     pesf_ignore
  30 };
  31 
  32 enum pe_weights {
  33     pe_weights_none = 0x0,
  34     pe_weights_init = 0x1,
  35     pe_weights_forward = 0x4,
  36     pe_weights_positive = 0x8,
  37     pe_weights_rollback = 0x10,
  38 };
  39 
  40 struct rsc_colocation_s {
  41     const char *id;
  42     const char *node_attribute;
  43     pe_resource_t *rsc_lh;
  44     pe_resource_t *rsc_rh;
  45 
  46     int role_lh;
  47     int role_rh;
  48 
  49     int score;
  50 };
  51 
  52 enum loss_ticket_policy_e {
  53     loss_ticket_stop,
  54     loss_ticket_demote,
  55     loss_ticket_fence,
  56     loss_ticket_freeze
  57 };
  58 
  59 struct rsc_ticket_s {
  60     const char *id;
  61     pe_resource_t *rsc_lh;
  62     pe_ticket_t *ticket;
  63     enum loss_ticket_policy_e loss_policy;
  64 
  65     int role_lh;
  66 };
  67 
  68 extern gboolean stage0(pe_working_set_t * data_set);
  69 extern gboolean probe_resources(pe_working_set_t * data_set);
  70 extern gboolean stage2(pe_working_set_t * data_set);
  71 extern gboolean stage3(pe_working_set_t * data_set);
  72 extern gboolean stage4(pe_working_set_t * data_set);
  73 extern gboolean stage5(pe_working_set_t * data_set);
  74 extern gboolean stage6(pe_working_set_t * data_set);
  75 extern gboolean stage7(pe_working_set_t * data_set);
  76 extern gboolean stage8(pe_working_set_t * data_set);
  77 
  78 extern gboolean summary(GListPtr resources);
  79 
  80 extern gboolean unpack_constraints(xmlNode * xml_constraints, pe_working_set_t * data_set);
  81 
  82 extern gboolean shutdown_constraints(pe_node_t * node, pe_action_t * shutdown_op,
  83                                      pe_working_set_t * data_set);
  84 
  85 void pcmk__order_vs_fence(pe_action_t *stonith_op, pe_working_set_t *data_set);
  86 
  87 extern int custom_action_order(pe_resource_t * lh_rsc, char *lh_task, pe_action_t * lh_action,
  88                                pe_resource_t * rh_rsc, char *rh_task, pe_action_t * rh_action,
  89                                enum pe_ordering type, pe_working_set_t * data_set);
  90 
  91 extern int new_rsc_order(pe_resource_t * lh_rsc, const char *lh_task,
  92                          pe_resource_t * rh_rsc, const char *rh_task,
  93                          enum pe_ordering type, pe_working_set_t * data_set);
  94 
  95 #  define order_start_start(rsc1,rsc2, type)                            \
  96     new_rsc_order(rsc1, CRMD_ACTION_START, rsc2, CRMD_ACTION_START, type, data_set)
  97 #  define order_stop_stop(rsc1, rsc2, type)                             \
  98     new_rsc_order(rsc1, CRMD_ACTION_STOP, rsc2, CRMD_ACTION_STOP, type, data_set)
  99 
 100 extern void graph_element_from_action(pe_action_t * action, pe_working_set_t * data_set);
 101 extern void add_maintenance_update(pe_working_set_t *data_set);
 102 xmlNode *pcmk__schedule_actions(pe_working_set_t *data_set, xmlNode *xml_input,
 103                                 crm_time_t *now);
 104 bool pcmk__ordering_is_invalid(pe_action_t *action, pe_action_wrapper_t *input);
 105 
 106 extern gboolean show_scores;
 107 extern gboolean show_utilization;
 108 extern const char *transition_idle_timeout;
 109 
 110 #endif

/* [previous][next][first][last][top][bottom][index][help] */