If a picture is worth a thousand words, then code that generates pictures from words is worth...uh, anyway, I wrote a script that produces dot output from Pacemaker start and colocation constraints:


You can pass this output to graphviz to create visualizations of your Pacemaker resource constraints.

The graph-constraints.py script in that repository consumes the output of cibadmin -Q and can produce output for either start constraints (-S, the default) or colocation constraints (-C).

Given a document like this, if you run:

cibadmin -Q | 
python graph-constraints.py -o cib.svg

You get a graph like this:

Nodes are colored by their tag (so, primitive, clone, etc).

Stupid Pacemaker XML tricks

Thu 19 February 2015 by Lars Kellogg-Stedman Tags pacemaker xml xpath

I've recently spent some time working with Pacemaker, and ended up with an interesting collection of XPath snippets that I am publishing here for your use and/or amusement.

Check if there are any inactive resources

pcs status xml |
  xmllint --xpath '//resource[@active="false"]' - >&/dev/null &&
  echo "There are inactive …
read more