40 GList *colocations = NULL;
62 for (GList *iter = colocations; iter != NULL; iter = iter->next) {
70 g_list_free(colocations);
75 g_list_free(colocations);
121 bool ordered =
false;
156 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
179 for (GList *later = iter->next;
180 later != NULL; later = later->next) {
223 "support the same number of instances per node",
252 const GList *iter = NULL;
253 int priority_delta = 0;
261 CRM_ASSERT((colocation != NULL) && pcmk__is_clone(primary)
262 && pcmk__is_primitive(dependent));
266 "Delaying processing colocation %s " 267 "because cloned primary %s is still provisional",
268 colocation->
id, primary->
id);
272 pcmk__rsc_trace(primary,
"Processing colocation %s (%s with clone %s @%s)",
273 colocation->
id, dependent->
id, primary->
id,
296 if (can_interleave(colocation)) {
302 if (primary_instance != NULL) {
304 dependent->
id, primary_instance->
id);
312 crm_notice(
"%s cannot run because it cannot interleave with " 313 "any instance of %s", dependent->
id, primary->
id);
318 "%s will not colocate with %s " 319 "because no instance can interleave with it",
320 dependent->
id, primary->
id);
328 GList *primary_nodes = NULL;
331 for (iter = primary->
children; iter != NULL; iter = iter->next) {
338 colocation->
id, pcmk__node_name(chosen),
340 primary_nodes = g_list_prepend(primary_nodes, chosen);
344 primary_nodes,
false);
345 g_list_free(primary_nodes);
350 for (iter = primary->
children; iter != NULL; iter = iter->next) {
359 return priority_delta;
367 CRM_CHECK((rsc != NULL) && (orig_rsc != NULL) && (list != NULL),
return);
371 if (rsc->
parent != NULL) {
381 CRM_CHECK((rsc != NULL) && (orig_rsc != NULL) && (list != NULL),
return);
385 if (rsc->
parent != NULL) {
417 CRM_CHECK((location != NULL) && pcmk__is_clone(rsc),
return);
421 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
430 call_action_flags(gpointer
data, gpointer user_data)
448 g_list_foreach(rsc->
actions, call_action_flags, rsc);
451 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
475 for (GList *child_iter = rsc->
children; child_iter != NULL;
476 child_iter = child_iter->next) {
480 if (rsc_probed_on(child, node)) {
491 g_hash_table_iter_init(&iter, rsc->
known_on);
492 while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &known_node)) {
493 if (pcmk__same_node(node, known_node)) {
514 for (GList *iter = clone->
children; iter != NULL; iter = iter->next) {
517 if (rsc_probed_on(instance, node)) {
538 for (GList *iter = clone->
children; (iter != NULL) && (child == NULL);
543 instance_node = instance->
fns->
location(instance, NULL, 0);
544 if (pcmk__same_node(instance_node, node)) {
570 CRM_ASSERT((node != NULL) && pcmk__is_clone(rsc));
585 if ((allowed == NULL)
592 "Skipping probe for %s on %s because resource has " 593 "exclusive discovery but is not allowed on node",
594 rsc->
id, pcmk__node_name(node));
604 return probe_anonymous_clone(rsc, node);
622 CRM_ASSERT(pcmk__is_clone(rsc) && (xml != NULL));
669 GHashTable *utilization)
671 bool existing =
false;
674 CRM_ASSERT(pcmk__is_clone(rsc) && (orig_rsc != NULL)
675 && (utilization != NULL));
682 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
684 if (g_list_find(all_rscs, child)) {
688 for (GList *member_iter = child->
children; member_iter != NULL;
689 member_iter = member_iter->next) {
693 if (g_list_find(all_rscs, member) != NULL) {
704 if (!existing && (rsc->
children != NULL)) {
pcmk_assignment_methods_t * cmds
#define CRM_CHECK(expr, failure_action)
#define pcmk__order_starts(rsc1, rsc2, flags)
void pcmk__clone_with_colocations(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL uint32_t pcmk__collective_action_flags(pcmk_action_t *action, const GList *instances, const pcmk_node_t *node)
#define crm_notice(fmt, args...)
'then' is runnable (and migratable) only if 'first' is runnable
G_GNUC_INTERNAL void pcmk__apply_location(pcmk_resource_t *rsc, pcmk__location_t *constraint)
pcmk_scheduler_t * cluster
pcmk_node_t *(* location)(const pcmk_resource_t *rsc, GList **list, int current)
const char * pcmk_readable_score(int score)
Return a displayable static string for a score value.
uint32_t(* action_flags)(pcmk_action_t *action, const pcmk_node_t *node)
G_GNUC_INTERNAL bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node)
#define pcmk__rsc_trace(rsc, fmt, args...)
#define pcmk__order_stops(rsc1, rsc2, flags)
uint32_t pcmk__clone_action_flags(pcmk_action_t *action, const pcmk_node_t *node)
const char * crm_xml_add_int(xmlNode *node, const char *name, int value)
Create an XML attribute with specified name and integer value.
gboolean exclusive_discover
#define pcmk__config_err(fmt...)
G_GNUC_INTERNAL pcmk_resource_t * pcmk__find_compatible_instance(const pcmk_resource_t *match_rsc, const pcmk_resource_t *rsc, enum rsc_role_e role, bool current)
G_GNUC_INTERNAL void pcmk__order_promotable_instances(pcmk_resource_t *clone)
G_GNUC_INTERNAL void pcmk__create_instance_actions(pcmk_resource_t *rsc, GList *instances)
int pe__clone_max(const pcmk_resource_t *clone)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
#define PCMK_META_INTERLEAVE
int pcmk__clone_apply_coloc_score(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
pcmk_node_t *(* assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
G_GNUC_INTERNAL void pcmk__create_promotable_actions(pcmk_resource_t *clone)
#define PCMK_META_CLONE_MAX
G_GNUC_INTERNAL bool pcmk__assign_resource(pcmk_resource_t *rsc, pcmk_node_t *node, bool force, bool stop_if_fail)
void(* add_actions_to_graph)(pcmk_resource_t *rsc)
#define pcmk__rsc_debug(rsc, fmt, args...)
void(* with_this_colocations)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
void pcmk__clone_shutdown_lock(pcmk_resource_t *rsc)
#define PCMK__META_PROMOTED_NODE_MAX_LEGACY
#define PCMK_META_GLOBALLY_UNIQUE
G_GNUC_INTERNAL void pcmk__add_with_this_list(GList **list, GList *addition, const pcmk_resource_t *rsc)
unsigned int(* max_per_node)(const pcmk_resource_t *rsc)
Actions are ordered (optionally, if no other flags are set)
#define PCMK_META_CLONE_NODE_MAX
void(* this_with_colocations)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__set_instance_roles(pcmk_resource_t *rsc)
G_GNUC_INTERNAL int pcmk__update_promotable_dependent_priority(const pcmk_resource_t *primary, pcmk_resource_t *dependent, const pcmk__colocation_t *colocation)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
G_GNUC_INTERNAL void pcmk__add_promotion_scores(pcmk_resource_t *rsc)
struct pe_node_shared_s * details
#define PCMK_ACTION_START
G_GNUC_INTERNAL gint pcmk__cmp_instance(gconstpointer a, gconstpointer b)
Wrappers for and extensions to libxml2.
#define PCMK__META_PROMOTED_MAX_LEGACY
void(* apply_location)(pcmk_resource_t *rsc, pcmk__location_t *location)
void pcmk__clone_create_actions(pcmk_resource_t *rsc)
#define pcmk__set_rsc_flags(resource, flags_to_set)
G_GNUC_INTERNAL void pcmk__assign_instances(pcmk_resource_t *collective, GList *instances, int max_total, int max_per_node)
G_GNUC_INTERNAL gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b)
int pcmk__add_scores(int score1, int score2)
bool is_set_recursive(const pcmk_resource_t *rsc, long long flag, bool any)
enum pe_obj_types variant
bool(* create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node)
int pe__clone_promoted_node_max(const pcmk_resource_t *clone)
int pe__clone_promoted_max(const pcmk_resource_t *clone)
#define pcmk__order_resource_actions(first_rsc, first_task, then_rsc, then_task, flags)
pcmk_resource_t * primary
G_GNUC_INTERNAL void pcmk__add_rsc_actions_to_graph(pcmk_resource_t *rsc)
pcmk_node_t * pcmk__clone_assign(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
G_GNUC_INTERNAL void pcmk__update_dependent_with_promotable(const pcmk_resource_t *primary, pcmk_resource_t *dependent, const pcmk__colocation_t *colocation)
Update dependent for a colocation with a promotable clone.
If 'then' is required, 'first' must be added to the transition graph.
void pe__create_clone_notifications(pcmk_resource_t *clone)
G_GNUC_INTERNAL GList * pcmk__with_this_colocations(const pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__add_dependent_scores(gpointer data, gpointer user_data)
void(* internal_constraints)(pcmk_resource_t *rsc)
void pcmk__clone_add_utilization(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
void pe__free_clone_notification_data(pcmk_resource_t *clone)
G_GNUC_INTERNAL void pcmk__add_this_with_list(GList **list, GList *addition, const pcmk_resource_t *rsc)
void pcmk__clone_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml)
#define PCMK_META_PROMOTED_NODE_MAX
If 'first' is required and runnable, 'then' must be in graph.
#define PCMK_ACTION_STOPPED
G_GNUC_INTERNAL GList * pcmk__this_with_colocations(const pcmk_resource_t *rsc)
void pcmk__clone_add_actions_to_graph(pcmk_resource_t *rsc)
void pcmk__with_clone_colocations(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
#define PCMK_ACTION_PROMOTE
pcmk_resource_t * dependent
#define pe__show_node_scores(level, rsc, text, nodes, scheduler)
#define PCMK_META_PROMOTED_MAX
int pe__clone_node_max(const pcmk_resource_t *clone)
gboolean crm_is_true(const char *s)
Resource role is unknown.
Location constraint object.
bool pe__clone_is_ordered(const pcmk_resource_t *clone)
#define PCMK_ACTION_RUNNING
#define PCMK_ACTION_DEMOTED
void pcmk__clone_apply_location(pcmk_resource_t *rsc, pcmk__location_t *location)
void(* add_utilization)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
#define pcmk__clear_rsc_flags(resource, flags_to_clear)
int(* apply_coloc_score)(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__colocation_intersect_nodes(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, const GList *primary_nodes, bool merge_scores)
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
bool pcmk__clone_create_probe(pcmk_resource_t *rsc, pcmk_node_t *node)
GHashTable * allowed_nodes
void pcmk__clone_internal_constraints(pcmk_resource_t *rsc)
char * crm_meta_name(const char *field)
Get the environment variable equivalent of a meta-attribute name.