Product SiteDocumentation Site

2.6. Making Configuration Changes in a Sandbox

Often it is desirable to preview the effects of a series of changes before updating the configuration atomically. For this purpose we have created crm_shadow which creates a "shadow" copy of the configuration and arranges for all the command line tools to use it.
To begin, simply invoke crm_shadow and give it the name of a configuration to create [5] ; be sure to follow the simple on-screen instructions.

Warning

Read the above carefully, failure to do so could result in you destroying the cluster’s active configuration!

Example 2.7. Creating and displaying the active sandbox

 # crm_shadow --create test
 Setting up shadow instance
 Type Ctrl-D to exit the crm_shadow shell
 shadow[test]:
 shadow[test] # crm_shadow --which
 test

From this point on, all cluster commands will automatically use the shadow copy instead of talking to the cluster’s active configuration. Once you have finished experimenting, you can either commit the changes, or discard them as shown below. Again, be sure to follow the on-screen instructions carefully.
For a full list of crm_shadow options and commands, invoke it with the <parameter>--help</parameter> option.

Example 2.8. Using a sandbox to make multiple changes atomically

 shadow[test] # crm_failcount -G -r rsc_c001n01
  name=fail-count-rsc_c001n01 value=0
 shadow[test] # crm_standby -v on -n c001n02
 shadow[test] # crm_standby -G -n c001n02
 name=c001n02 scope=nodes value=on
 shadow[test] # cibadmin --erase --force
 shadow[test] # cibadmin --query
 <cib cib_feature_revision="1" validate-with="pacemaker-1.0" admin_epoch="0" crm_feature_set="3.0" have-quorum="1" epoch="112"
      dc-uuid="c001n01" num_updates="1" cib-last-written="Fri Jun 27 12:17:10 2008">
    <configuration>
       <crm_config/>
       <nodes/>
       <resources/>
       <constraints/>
    </configuration>
    <status/>
 </cib>
  shadow[test] # crm_shadow --delete test --force
  Now type Ctrl-D to exit the crm_shadow shell
  shadow[test] # exit
  # crm_shadow --which
  No shadow instance provided
  # cibadmin -Q
 <cib cib_feature_revision="1" validate-with="pacemaker-1.0" admin_epoch="0" crm_feature_set="3.0" have-quorum="1" epoch="110"
       dc-uuid="c001n01" num_updates="551">
    <configuration>
       <crm_config>
          <cluster_property_set id="cib-bootstrap-options">
             <nvpair id="cib-bootstrap-1" name="stonith-enabled" value="1"/>
             <nvpair id="cib-bootstrap-2" name="pe-input-series-max" value="30000"/>

Making changes in a sandbox and verifying the real configuration is untouched


[5] Shadow copies are identified with a name, making it possible to have more than one.