12 #include <sys/param.h> 73 xmlNode *section = NULL;
113 crm_warn(
"Fencing and resource management disabled due to lack of quorum");
142 crm_trace(
"Cluster resource count: %d (%d disabled, %d blocked)",
163 pe_free_resources(GList *resources)
166 GList *iterator = resources;
168 while (iterator != NULL) {
170 iterator = iterator->next;
173 if (resources != NULL) {
174 g_list_free(resources);
179 pe_free_actions(GList *actions)
181 GList *iterator = actions;
183 while (iterator != NULL) {
185 iterator = iterator->next;
187 if (actions != NULL) {
188 g_list_free(actions);
193 pe_free_nodes(GList *nodes)
195 for (GList *iterator = nodes; iterator != NULL; iterator = iterator->next) {
211 "(guest or remote)" : pe__node_name(node)));
233 pe__free_ordering(GList *constraints)
235 GList *iterator = constraints;
237 while (iterator != NULL) {
240 iterator = iterator->next;
246 if (constraints != NULL) {
247 g_list_free(constraints);
252 pe__free_location(GList *constraints)
254 GList *iterator = constraints;
256 while (iterator != NULL) {
259 iterator = iterator->next;
265 if (constraints != NULL) {
266 g_list_free(constraints);
344 crm_trace(
"Deleting %d ordering constraints",
349 crm_trace(
"Deleting %d location constraints",
354 crm_trace(
"Deleting %d colocation constraints",
359 crm_trace(
"Deleting %d ticket constraints",
401 for (rIter = rsc_list;
id && rIter; rIter = rIter->next) {
433 if ((match == NULL) && (
uname != NULL)) {
450 for (
const GList *iter = nodes; iter != NULL; iter = iter->next) {
475 for (
const GList *iter = nodes; iter != NULL; iter = iter->next) {
GHashTable * tags
Configuration tags (ID -> pcmk_tag_t *)
#define CRM_CHECK(expr, failure_action)
enum pe_quorum_policy no_quorum_policy
Response to loss of quorum.
bool pe__is_guest_or_remote_node(const pcmk_node_t *node)
xmlNode * failed
History entries of failed actions.
GHashTable * attrs
Node attributes.
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
Whether cluster is symmetric (via symmetric-cluster property)
pe_find
Search options for resources (exact resource ID always matches)
Whether partition has quorum (via have-quorum property)
xmlNode * op_defaults
Configured operation defaults.
pcmk_resource_t * pe_find_resource_with_flags(GList *rsc_list, const char *id, enum pe_find flags)
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
#define pe__set_working_set_flags(scheduler, flags_to_set)
Whether the CIB status section has been parsed yet.
Whether concurrent fencing is allowed (via concurrent-fencing property)
GList * actions
Scheduled actions.
int order_id
ID to use for next created ordering.
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
bool pcmk__xe_attr_is_true(const xmlNode *node, const char *name)
#define XML_CIB_TAG_NODES
Implementation of pcmk_scheduler_t.
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
G_GNUC_INTERNAL gboolean unpack_resources(const xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
char * dc_uuid
Node ID of designated controller.
int ninstances
Total number of resource instances.
#define PCMK__CONCURRENT_FENCING_DEFAULT
GList * resources
Resources in cluster.
pcmk_node_t * pe_find_node_id(const GList *nodes, const char *id)
Find a node by ID in a list of nodes.
GList * nodes
Nodes in cluster.
Also match clone instance ID from resource history.
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler)
#define XML_CIB_TAG_RESOURCES
GList * ticket_constraints
#define crm_warn(fmt, args...)
void(* free)(pcmk_resource_t *rsc)
Free all memory used by a resource.
Implementation of pcmk_resource_t.
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
gboolean cluster_status(pcmk_scheduler_t *scheduler)
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
xmlNode * rsc_defaults
Configured resource defaults.
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
#define crm_trace(fmt, args...)
void * priv
For Pacemaker use only.
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
int blocked_resources
Number of blocked resources in cluster.
int action_id
ID to use for next created action.
struct pe_node_shared_s * details
Basic node information.
#define XML_ATTR_HAVE_QUORUM
const char * uname
Node name in cluster.
Wrappers for and extensions to libxml2.
GHashTable * config_hash
Cluster properties.
xmlNode * create_xml_node(xmlNode *parent, const char *name)
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler)
void free_xml(xmlNode *child)
void cleanup_calculations(pcmk_scheduler_t *scheduler)
Reset scheduler data to defaults without freeing it or constraints.
Implementation of pcmk_node_t.
const char * id
Node ID at the cluster layer.
GList * running_rsc
List of resources active on node.
GList * ordering_constraints
Ordering constraints.
pcmk_rsc_methods_t * fns
Resource object methods.
pcmk_scheduler_t * scheduler
int disabled_resources
Number of disabled resources in cluster.
crm_time_t * crm_time_new(const char *string)
#define XML_CIB_TAG_CRMCONFIG
#define XML_CIB_TAG_RSCCONFIG
GList * colocation_constraints
Colocation constraints.
void pe_free_action(pcmk_action_t *action)
GHashTable * utilization
Node utilization attributes.
Skip counting of total, disabled, and blocked resource instances.
pcmk_node_t * pe_find_node_any(const GList *nodes, const char *id, const char *uname)
Find a node by name or ID in a list of nodes.
GHashTable * digest_cache
Cache of calculated resource digests.
GList * placement_constraints
Location constraints.
#define XML_CIB_TAG_STATUS
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler)
GHashTable * singletons
Actions for which there can be only one (such as "fence node X")
unsigned long long flags
Group of enum pcmk_scheduler_flags.
GList * allocated_rsc
List of resources assigned to node.
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id)
#define XML_CIB_TAG_OPCONFIG
void pe_reset_working_set(pcmk_scheduler_t *scheduler)
Reset scheduler data to default state without freeing it.
crm_time_t * now
Current time for evaluation purposes.
GHashTable * template_rsc_sets
Mappings of template ID to resource ID.
#define pe__clear_working_set_flags(scheduler, flags_to_clear)
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler)
GList * stop_needed
Containers that need stop actions.
xmlNode * graph
Transition graph.
void crm_time_free(crm_time_t *dt)
pcmk_node_t * pe_find_node(const GList *nodes, const char *node_name)
Find a node by name in a list of nodes.