pacemaker
2.0.1-9e909a5bdd
Scalable High-Availability cluster resource manager
include
crm
pengine
common.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
8
*
9
* This software is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
#ifndef PE_COMMON__H
19
# define PE_COMMON__H
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
# include <glib.h>
26
27
extern
gboolean
was_processing_error
;
28
extern
gboolean
was_processing_warning
;
29
30
/* order is significant here
31
* items listed in order of accending severeness
32
* more severe actions take precedent over lower ones
33
*/
34
enum
action_fail_response
{
35
action_fail_ignore
,
36
action_fail_recover
,
37
action_fail_migrate
,
/* recover by moving it somewhere else */
38
action_fail_block
,
39
action_fail_stop
,
40
action_fail_standby
,
41
action_fail_fence
,
42
action_fail_restart_container
,
43
/* This is reserved for internal use for baremetal remote node connection
44
* resources. This fail action means
45
* 1. If stonith is enabled, fence the baremetal remote node
46
* 2. stonith not enabled, attempt to recover the connection resources
47
*
48
* This response value gives us control of saying types of
49
* connection resource failures result in fencing the remote node.
50
* Example: recurring monitors failure should result in fencing.
51
*/
52
action_fail_reset_remote
,
53
54
};
55
56
/* the "done" action must be the "pre" action +1 */
57
enum
action_tasks
{
58
no_action
,
59
monitor_rsc
,
60
stop_rsc
,
61
stopped_rsc
,
62
start_rsc
,
63
started_rsc
,
64
action_notify
,
65
action_notified
,
66
action_promote
,
67
action_promoted
,
68
action_demote
,
69
action_demoted
,
70
shutdown_crm
,
71
stonith_node
72
};
73
74
enum
rsc_recovery_type
{
75
recovery_stop_start
,
76
recovery_stop_only
,
77
recovery_block
78
};
79
80
enum
rsc_start_requirement
{
81
rsc_req_nothing
,
/* Allowed by custom_action() */
82
rsc_req_quorum
,
/* Enforced by custom_action() */
83
rsc_req_stonith
/* Enforced by native_start_constraints() */
84
};
85
86
enum
rsc_role_e
{
87
RSC_ROLE_UNKNOWN
,
88
RSC_ROLE_STOPPED
,
89
RSC_ROLE_STARTED
,
90
RSC_ROLE_SLAVE
,
91
RSC_ROLE_MASTER
,
92
};
93
94
# define RSC_ROLE_MAX RSC_ROLE_MASTER+1
95
96
# define RSC_ROLE_UNKNOWN_S "Unknown"
97
# define RSC_ROLE_STOPPED_S "Stopped"
98
# define RSC_ROLE_STARTED_S "Started"
99
# define RSC_ROLE_SLAVE_S "Slave"
100
# define RSC_ROLE_MASTER_S "Master"
101
102
enum
pe_print_options
{
103
pe_print_log
= 0x0001,
104
pe_print_html
= 0x0002,
105
pe_print_ncurses
= 0x0004,
106
pe_print_printf
= 0x0008,
107
pe_print_dev
= 0x0010,
108
pe_print_details
= 0x0020,
109
pe_print_max_details
= 0x0040,
110
pe_print_rsconly
= 0x0080,
111
pe_print_ops
= 0x0100,
112
pe_print_suppres_nl
= 0x0200,
113
pe_print_xml
= 0x0400,
114
pe_print_brief
= 0x0800,
115
pe_print_pending
= 0x1000,
116
pe_print_clone_details
= 0x2000,
117
pe_print_clone_active
= 0x4000,
// Print clone instances only if active
118
pe_print_implicit
= 0x8000,
// Print implicitly created resources
119
};
120
121
const
char
*
task2text
(
enum
action_tasks
task);
122
enum
action_tasks
text2task
(
const
char
*task);
123
enum
rsc_role_e
text2role
(
const
char
*role);
124
const
char
*
role2text
(
enum
rsc_role_e
role);
125
const
char
*
fail2text
(
enum
action_fail_response
fail);
126
127
const
char
*
pe_pref
(GHashTable * options,
const
char
*name);
128
void
calculate_active_ops
(GList * sorted_op_list,
int
*start_index,
int
*stop_index);
129
130
static
inline
const
char
*
131
recovery2text(
enum
rsc_recovery_type
type
)
132
{
133
switch
(
type
) {
134
case
recovery_stop_only
:
135
return
"shutting it down"
;
136
case
recovery_stop_start
:
137
return
"attempting recovery"
;
138
case
recovery_block
:
139
return
"waiting for an administrator"
;
140
}
141
return
"Unknown"
;
142
}
143
144
#ifdef __cplusplus
145
}
146
#endif
147
148
#endif
action_fail_response
action_fail_response
Definition:
common.h:34
pe_print_log
Definition:
common.h:103
pe_print_suppres_nl
Definition:
common.h:112
action_fail_standby
Definition:
common.h:40
pe_print_xml
Definition:
common.h:113
pe_print_dev
Definition:
common.h:107
RSC_ROLE_STOPPED
Definition:
common.h:88
action_demote
Definition:
common.h:68
action_fail_stop
Definition:
common.h:39
pe_print_max_details
Definition:
common.h:109
RSC_ROLE_MASTER
Definition:
common.h:91
started_rsc
Definition:
common.h:63
rsc_req_quorum
Definition:
common.h:82
pe_print_clone_active
Definition:
common.h:117
rsc_role_e
rsc_role_e
Definition:
common.h:86
stop_rsc
Definition:
common.h:60
was_processing_warning
gboolean was_processing_warning
Definition:
common.c:19
pe_print_brief
Definition:
common.h:114
pe_pref
const char * pe_pref(GHashTable *options, const char *name)
Definition:
common.c:181
stopped_rsc
Definition:
common.h:61
action_fail_recover
Definition:
common.h:36
type
enum crm_ais_msg_types type
Definition:
internal.h:83
pe_print_ncurses
Definition:
common.h:105
text2task
enum action_tasks text2task(const char *task)
Definition:
common.c:224
action_notify
Definition:
common.h:64
rsc_start_requirement
rsc_start_requirement
Definition:
common.h:80
rsc_recovery_type
rsc_recovery_type
Definition:
common.h:74
pe_print_clone_details
Definition:
common.h:116
pe_print_ops
Definition:
common.h:111
pe_print_details
Definition:
common.h:108
action_fail_block
Definition:
common.h:38
RSC_ROLE_SLAVE
Definition:
common.h:90
action_notified
Definition:
common.h:65
action_fail_fence
Definition:
common.h:41
pe_print_html
Definition:
common.h:104
pe_print_options
pe_print_options
Definition:
common.h:102
pe_print_rsconly
Definition:
common.h:110
action_fail_migrate
Definition:
common.h:37
action_fail_reset_remote
Definition:
common.h:52
role2text
const char * role2text(enum rsc_role_e role)
Definition:
common.c:329
RSC_ROLE_UNKNOWN
Definition:
common.h:87
action_demoted
Definition:
common.h:69
rsc_req_stonith
Definition:
common.h:83
shutdown_crm
Definition:
common.h:70
action_fail_restart_container
Definition:
common.h:42
action_promoted
Definition:
common.h:67
text2role
enum rsc_role_e text2role(const char *role)
Definition:
common.c:350
rsc_req_nothing
Definition:
common.h:81
recovery_stop_only
Definition:
common.h:76
action_promote
Definition:
common.h:66
pe_print_printf
Definition:
common.h:106
recovery_stop_start
Definition:
common.h:75
start_rsc
Definition:
common.h:62
pe_print_implicit
Definition:
common.h:118
action_fail_ignore
Definition:
common.h:35
calculate_active_ops
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
Definition:
unpack.c:2103
pe_print_pending
Definition:
common.h:115
was_processing_error
gboolean was_processing_error
Definition:
common.c:18
RSC_ROLE_STARTED
Definition:
common.h:89
stonith_node
Definition:
common.h:71
action_tasks
action_tasks
Definition:
common.h:57
recovery_block
Definition:
common.h:77
monitor_rsc
Definition:
common.h:59
fail2text
const char * fail2text(enum action_fail_response fail)
Definition:
common.c:187
no_action
Definition:
common.h:58
task2text
const char * task2text(enum action_tasks task)
Definition:
common.c:276
Generated on Mon Feb 10 2020 07:15:04 for pacemaker by
1.8.16