Visualizing Heartbeat (HA) managed resource dependencies
This tip explains how to visualize HA managed resources and their dependencies with a graph.
I have 2 HASI clusters managing XEN virtual machines as resources and as part of my documentation I wanted to visualize the various resources and their dependencies.
These are available from standard SLES10 SP2 installation sources.
graphviz-2.6-22.2 is available from SLE10SP2 SDK (Software Development Kit) media or installation source.
Heartbeat package includes a tool named “ptest” which is used for testing for instance modified crm (V2) configurations without actually loading them into the cluster.
geeko:~ # rpm -qf /usr/sbin/ptest heartbeat-2.1.3-0.9
Get a full config of your V2 cluster without “lrm” lines:
geeko:~ # cibadmin -Q | grep -v lrm > `hostname`.xml
By removing the lrm_resources tags (grep -v lrm), the tool thinks that nothing is running and shows what it would do to start everything from scratch.
Translate the saved xml file to DOT formatted transition graph:
geeko:~ # ptest -D `hostname`.dot -X `hostname`.xml
Draw a directed graph:
geeko:~ # dot -Tjpg -o `hostname`.jpg `hostname`.dot
There are other utilities available drawing different type of graphs (neato, twopi, circo, fdp), you can get some idea about what they do from the man pages.