crm_simulate8
Part of the pacemaker cluster resource manager
Usage
crm_simulate <data
source>
<operation>
[options]
Overview
crm_simulate - simulate a Pacemaker cluster's response to events
Options
Help Options:
-
-h, --help -
Show help options
-
--help-all -
Show all help options
-
--help-output -
Show output help
-
--help-operations -
Show operations options
-
--help-synthetic -
Show synthetic cluster event options
-
--help-artifact -
Show artifact options
-
--help-source -
Show data source options
Output Options:
-
--output-as=FORMAT -
Specify output format as one of: text (default), xml
-
--output-to=DEST -
Specify file name for output (or "-" for stdout)
Operations:
-
-R, --run -
Process the supplied input and show what actions the cluster will take in response
-
-S, --simulate -
Like
--run, but also simulate taking those actions and show the resulting new status
-
-X, --in-place -
Like
--simulate, but also store the results back to the input file
-
-A, --show-attrs -
Show node attributes
-
-c, --show-failcounts -
Show resource fail counts
-
-s, --show-scores -
Show allocation scores
-
-U, --show-utilization -
Show utilization information
-
-P, --profile=DIR -
Process all the XML files in the named directory to create profiling data
-
-N, --repeat=N -
With
--profile, repeat each test N times and print timings
Synthetic Cluster Events:
-
-u, --node-up=NODE -
Simulate bringing a node online
-
-d, --node-down=NODE -
Simulate taking a node offline
-
-f, --node-fail=NODE -
Simulate a node failing
-
-i, --op-inject=OPSPEC -
Generate a failure for the cluster to react to in the simulation. See `Operation Specification` help for more information.
-
-F, --op-fail=OPSPEC -
If the specified task occurs during the simulation, have it fail with return code ${rc}. The transition will normally stop at the failed action. Save the result with
--save-outputand re-run with--xml-file. See `Operation Specification` help for more information.
-
-t, --set-datetime=DATETIME -
Set date/time (ISO 8601 format, see https://en.wikipedia.org/wiki/ISO_8601)
-
-q, --quorum=QUORUM -
Set to '1' (or 'true') to indicate cluster has quorum
-
-w, --watchdog=DEVICE -
Set to '1' (or 'true') to indicate cluster has an active watchdog device
-
-g, --ticket-grant=TICKET -
Simulate granting a ticket
-
-r, --ticket-revoke=TICKET -
Simulate revoking a ticket
-
-b, --ticket-standby=TICKET -
Simulate making a ticket standby
-
-e, --ticket-activate=TICKET -
Simulate activating a ticket
Artifact Options:
-
-I, --save-input=FILE -
Save the input configuration to the named file
-
-O, --save-output=FILE -
Save the output configuration to the named file
-
-G, --save-graph=FILE -
Save the transition graph (XML format) to the named file
-
-D, --save-dotfile=FILE -
Save the transition graph (DOT format) to the named file
-
-a, --all-actions -
Display all possible actions in DOT graph (even if not part of transition)
Data Source:
-
-L, --live-check -
Connect to CIB manager and use the current CIB contents as input
-
-x, --xml-file=FILE -
Retrieve XML from the named file
-
-p, --xml-pipe -
Retrieve XML from stdin
Application Options:
-
-$, --version -
Display software version and exit
-
-V, --verbose -
Increase debug output (may be specified multiple times)
-
-Q, --quiet -
Display only essential output
Operation specification
The OPSPEC in any command line option is of the form ${resource}_${task}_${interval_in_ms}@${node}=${rc} ([email protected]=7, for example). ${rc} is an OCF return code. For more information on these return codes, refer to https://clusterlabs.org/pacemaker/doc/2.1/Pacemaker_Administration/html/agents.html#ocf-return-codes
Examples
Pretend a recurring monitor action found memcached stopped on node fred.example.com and, during recovery, that the memcached stop action failed:
-
crm_simulate -LS --op-inject memcached:[email protected]=7 --op-fail memcached:[email protected]=1 --save-output /tmp/memcached-test.xml
Now see what the reaction to the stop failed would be:
-
crm_simulate -S --xml-file /tmp/memcached-test.xml
Releases
6 releases since Debian 7 (Wheezy); the text changed 5 times.
--help-all since Debian 11 (Bullseye);
--help-artifact since Debian 12 (Bookworm);
--help-operations since Debian 11 (Bullseye);
--help-output since Debian 11 (Bullseye);
--help-source since Debian 11 (Bullseye);
--help-synthetic since Debian 11 (Bullseye);
--in-place since Debian 11 (Bullseye);
--output-as since Debian 12 (Bookworm);
--output-to since Debian 12 (Bookworm);
--repeat since Debian 11 (Bullseye);
--show-attrs since Debian 12 (Bookworm);
--show-failcounts since Debian 12 (Bookworm);
--show-utilization since Debian 11 (Bullseye);
--simulate since Debian 11 (Bullseye);
--watchdog since Debian 9 (Stretch);
-A since Debian 12 (Bookworm);
-N since Debian 11 (Bullseye);
-S since Debian 11 (Bullseye);
-U since Debian 11 (Bullseye);
-X since Debian 11 (Bullseye);
-c since Debian 12 (Bookworm);
-h since Debian 11 (Bullseye);
-w since Debian 9 (Stretch).
--pending until Debian 11 (Bullseye);
--text-fancy until Debian 12 (Bookworm);
-? until Debian 10 (Buster);
-j until Debian 11 (Bullseye).