.TRY node show
node1: member
.TRY node show node1
node1: member
.SETENV showobj=node1
.TRY node standby node1
.EXT crm_attribute -t nodes -N 'node1' -n standby -v 'on' --lifetime='forever'
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="on"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY node online node1
.EXT crm_attribute -t nodes -N 'node1' -n standby -v 'off' --lifetime='forever'
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY configure primitive p5 Dummy
.EXT crm_resource --show-metadata ocf:heartbeat:Dummy
.EXT crm_resource --show-metadata ocf:pacemaker:Dummy
.EXT crm_resource --show-metadata stonith:null
.EXT stonithd metadata
.EXT crm_resource --show-metadata ocf:heartbeat:Delay
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY configure group g0 p5
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY resource maintenance g0
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY resource maintenance p5
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY -F node maintenance node1
INFO: 'maintenance' attribute already exists in p5. Remove it? [YES]
INFO: 'maintenance' attribute already exists in g0. Remove it? [YES]
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
          <nvpair id="nodes-node1-maintenance" name="maintenance" value="true"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY node ready node1
.EXT crm_attribute -t nodes -N 'node1' -n maintenance -v 'off'
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
          <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY node attribute node1 set a1 "1 2 3"
.EXT crm_attribute -t nodes -N 'node1' -n 'a1' -v '1 2 3'
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
          <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
          <nvpair id="nodes-node1-a1" name="a1" value="1 2 3"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY node attribute node1 show a1
.EXT crm_attribute -G -t nodes -N 'node1' -n 'a1'
scope=nodes  name=a1 value=1 2 3
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
          <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
          <nvpair id="nodes-node1-a1" name="a1" value="1 2 3"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY node attribute node1 delete a1
.EXT crm_attribute -D -t nodes -N 'node1' -n 'a1'
Deleted nodes attribute: id=nodes-node1-a1 name=a1

.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
          <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY node clearstate node1
.INP: configure
.INP: _regtest on
.INP: show xml node1
<?xml version="1.0" ?>
<cib>
  <configuration>
    <crm_config/>
    <nodes>
      <node uname="node1" id="node1">
        <instance_attributes id="nodes-node1">
          <nvpair id="nodes-node1-standby" name="standby" value="off"/>
          <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
        </instance_attributes>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

