
This is my thoughts on a detailed algorithm for the PolicyEngineComputation[1].
NOTE: The current algorithm places the importance of running of all resources over the running of a resource on a given node.
node {
char *id;
int weight;
};
color {
int id;
node *candidate_nodes;
node chosen_node;
};
placement_constraint {
resource res_lh;
resource res_rh;
node node_rh;
enum contype operation;
};
resource {
char *id;
xmlNodePtr xml;
int priority;
int *candidate_colors;
int color;
gboolean provisional;
node *allowed_nodes;
placement_constraint *positive;
placement_constraint *negative;
};
Duplicate and invert binary constraints (A != B --> A != B, B != A)
if resource.negative.res_rh.provisional == FALSE
Remove resource.negative.res_rh.color from resource.candiate_colors
If resource.candidate_color.candidate_nodes & resource.allowed_nodes != NULL
resource.candidate_color.candidate_nodes &= resource.allowed_nodes
If resource.provisional = FALSE
Add current color to resource.candidate_colors
if resource.negative.res_rh.provisional == FALSE
Remove resource.color from resource.negative.res_rh.candidate_colors
For colors,
Else if color(n) & !color(n+1) != NULL
Sort (color(n) & !color(n+1)) by weight
Sort (color(n+1) & !color(n)) by weight
| [1] | http://www.linux-ha.org/PolicyEngineComputation |
This information provided courtesy of the Linux-HA project at http://linux-ha.org/