Product SiteDocumentation Site

5.5. Simulate Cluster Activity with crm_simulate

The command-line tool crm_simulate shows the results of the same logic the cluster itself uses to respond to a particular cluster configuration and status.
As always, the man page is the primary documentation, and should be consulted for further details. This section aims for a better conceptual explanation and practical examples.

5.5.1. Replaying cluster decision-making logic

At any given time, one node in a Pacemaker cluster will be elected DC, and that node will run Pacemaker’s scheduler to make decisions.
Each time decisions need to be made (a "transition"), the DC will have log messages like "Calculated transition … saving inputs in …" with a file name. You can grab the named file and replay the cluster logic to see why particular decisions were made. The file contains the live cluster configuration at that moment, so you can also look at it directly to see the value of node attributes, etc., at that time.
The simplest usage is (replacing $FILENAME with the actual file name):

Example 5.8. Simulate cluster response to a given CIB

crm_simulate --simulate --xml-file $FILENAME
That will show the cluster state when the process started, the actions that need to be taken ("Transition Summary"), and the resulting cluster state if the actions succeed. Most actions will have a brief description of why they were required.
The transition inputs may be compressed. crm_simulate can handle these compressed files directly, though if you want to edit the file, you’ll need to uncompress it first.
You can do the same simulation for the live cluster configuration at the current moment. This is useful mainly when using crm_shadow to create a sandbox version of the CIB; the --live-check option will use the shadow CIB if one is in effect.

Example 5.9. Simulate cluster response to current live CIB or shadow CIB

crm_simulate --simulate --live-check