Pacemaker - Part of the Pacemaker cluster resource manager
crm_simulate <data source> <operation> [options]
crm_simulate - simulate a Pacemaker cluster's response to
events
- -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
- -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-output and 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
- -$, --version
- Display software version and exit
- -V, --verbose
- Increase debug output (may be specified multiple times)
- -Q, --quiet
- Display only essential output
The OPSPEC in any command line option is of the form
${resource}_${task}_${interval_in_ms}@${node}=${rc}
(memcached_monitor_20000@bart.example.com=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
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:0_monitor_20000@bart.example.com=7
--op-fail memcached:0_stop_0@fred.example.com=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
Written by Andrew Beekhof and the Pacemaker project
contributors