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)",
163pe_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);
179pe_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);
193pe_free_nodes(GList *nodes)
195 for (GList *iterator = nodes; iterator != NULL; iterator = iterator->next) {
202 if (node->details == NULL) {
211 "(guest or remote)" : pe__node_name(node)));
213 if (node->details->attrs != NULL) {
214 g_hash_table_destroy(node->details->attrs);
216 if (node->details->utilization != NULL) {
217 g_hash_table_destroy(node->details->utilization);
219 if (node->details->digest_cache != NULL) {
220 g_hash_table_destroy(node->details->digest_cache);
222 g_list_free(node->details->running_rsc);
223 g_list_free(node->details->allocated_rsc);
233pe__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);
252pe__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) {
bool pcmk__xe_attr_is_true(const xmlNode *node, const char *name)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define PCMK__CONCURRENT_FENCING_DEFAULT
void crm_time_free(crm_time_t *dt)
crm_time_t * crm_time_new(const char *string)
#define crm_warn(fmt, args...)
#define CRM_CHECK(expr, failure_action)
#define crm_trace(fmt, args...)
#define XML_CIB_TAG_RESOURCES
#define XML_CIB_TAG_RSCCONFIG
#define XML_CIB_TAG_CRMCONFIG
#define XML_ATTR_HAVE_QUORUM
#define XML_CIB_TAG_NODES
#define XML_CIB_TAG_STATUS
#define XML_CIB_TAG_OPCONFIG
pcmk_scheduler_t * scheduler
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
G_GNUC_INTERNAL gboolean unpack_resources(const xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler)
#define pe__set_working_set_flags(scheduler, flags_to_set)
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
void pe_free_action(pcmk_action_t *action)
#define pe__clear_working_set_flags(scheduler, flags_to_clear)
bool pe__is_guest_or_remote_node(const pcmk_node_t *node)
pe_find
Search options for resources (exact resource ID always matches)
@ pcmk_rsc_match_history
Also match clone instance ID from resource history.
@ pcmk_sched_stop_removed_resources
@ pcmk_sched_symmetric_cluster
Whether cluster is symmetric (via symmetric-cluster property)
@ pcmk_sched_no_counts
Skip counting of total, disabled, and blocked resource instances.
@ pcmk_sched_location_only
@ pcmk_sched_quorate
Whether partition has quorum (via have-quorum property)
@ pcmk_sched_concurrent_fencing
Whether concurrent fencing is allowed (via concurrent-fencing property)
@ pcmk_sched_have_status
Whether the CIB status section has been parsed yet.
@ pcmk_sched_cancel_removed_actions
pcmk_node_t * pe_find_node_id(const GList *nodes, const char *id)
Find a node by ID in a list of nodes.
pcmk_node_t * pe_find_node(const GList *nodes, const char *node_name)
Find a node by name in a list of nodes.
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
void pe_reset_working_set(pcmk_scheduler_t *scheduler)
Reset scheduler data to default state without freeing it.
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.
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id)
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
gboolean cluster_status(pcmk_scheduler_t *scheduler)
void cleanup_calculations(pcmk_scheduler_t *scheduler)
Reset scheduler data to defaults without freeing it or constraints.
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
pcmk_resource_t * pe_find_resource_with_flags(GList *rsc_list, const char *id, enum pe_find flags)
Implementation of pcmk_node_t.
struct pe_node_shared_s * details
Basic node information.
const char * id
Node ID at the cluster layer.
const char * uname
Node name in cluster.
Implementation of pcmk_resource_t.
pcmk_rsc_methods_t * fns
Resource object methods.
Implementation of pcmk_scheduler_t.
GHashTable * singletons
Actions for which there can be only one (such as "fence node X")
GList * colocation_constraints
Colocation constraints.
GList * ticket_constraints
char * dc_uuid
Node ID of designated controller.
int action_id
ID to use for next created action.
GHashTable * tags
Configuration tags (ID -> pcmk_tag_t *)
int blocked_resources
Number of blocked resources in cluster.
int ninstances
Total number of resource instances.
GHashTable * config_hash
Cluster properties.
GList * actions
Scheduled actions.
GHashTable * template_rsc_sets
Mappings of template ID to resource ID.
GList * resources
Resources in cluster.
xmlNode * failed
History entries of failed actions.
xmlNode * graph
Transition graph.
int disabled_resources
Number of disabled resources in cluster.
unsigned long long flags
Group of enum pcmk_scheduler_flags.
xmlNode * rsc_defaults
Configured resource defaults.
void * priv
For Pacemaker use only.
xmlNode * op_defaults
Configured operation defaults.
enum pe_quorum_policy no_quorum_policy
Response to loss of quorum.
GList * stop_needed
Containers that need stop actions.
GList * placement_constraints
Location constraints.
GList * nodes
Nodes in cluster.
GList * ordering_constraints
Ordering constraints.
crm_time_t * now
Current time for evaluation purposes.
int order_id
ID to use for next created ordering.
void(* free)(pcmk_resource_t *rsc)
Free all memory used by a resource.
pcmk_resource_t *(* find_rsc)(pcmk_resource_t *rsc, const char *search, const pcmk_node_t *node, int flags)
Search for a resource ID in a resource and its children.
Wrappers for and extensions to libxml2.
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
void free_xml(xmlNode *child)
xmlNode * create_xml_node(xmlNode *parent, const char *name)