powermac:~ andrew$ cibadmin -?
usage: cibadmin [V?i:o:QDUCEX:t:Srwlsh:MmBfbdRx:p] command
where necessary, XML data will be obtained using -X, -x, or -p options
Options
--id (-i) <id> id of the object being operated on
--obj_type (-o) <type> object type being operated on
Valid values are: nodes, resources, status, constraints
--verbose (-V) turn on debug info. additional instance increase verbosity
--help (-?) this help message
Commands
--cib_erase (-E)
--cib_query (-Q)
--cib_create (-C)
--cib_replace (-R)
--cib_update (-U)
--cib_delete (-D)
Delete the first object matching the supplied criteria
Eg. <op id="rsc1_op1" name="monitor"/>
The tagname and all attributes must match in order for the element to be deleted
--cib_delete_alt (-d)
Delete the object at specified fully qualified location
Eg. <resource id="rsc1"><operations><op id="rsc1_op1"/>...
Requires -o
--cib_bump (-B)
--cib_ismaster (-M)
--cib_sync (-S)
XML data
--crm_xml (-X) <string> Retrieve XML from the supplied string
--xml-file (-x) <filename> Retrieve XML from the named file
--xml-pipe (-p) Retrieve XML from STDIN
Advanced Options
--host (-h) send command to specified host. Applies to cib_query and cib_sync commands only
--local (-l) command takes effect locally on the specified host
--no-bcast (-b) command will not be broadcast even if it altered the CIB
--sync-call (-s) wait for call to complete before returning
Note: the -x and -p options were added in 2.0.3.
Here is an example of adding a resource to the CIB:
cibadmin -C -o resources -X '<primitive id="WebServerIP" class="ocf" type="IPaddr" provider="heartbeat">
<instance_attributes>
<attributes>
<nvpair id="WebServerIP_ip" name="ip" value="127.0.0.26"/>
</attributes>
</instance_attributes>
</primitive>'
Alternatively, you could put the XML into a file and do this:
cibadmin -C -o resources -x file.xml
One could then perform the following command to then add an extra parameter:
cibadmin -U -o resources -X '<primitive id="WebServerIP">
<instance_attributes>
<attributes>
<nvpair id="WebServerIP_nic" name="nic" value="eth0"/>
</attributes>
</instance_attributes>
</primitive>'
Or, you could perform the same thing doing this:
cibadmin -R -o resources -X '<primitive id="WebServerIP" class="ocf" type="IPaddr" provider="heartbeat">
<instance_attributes>
<attributes>
<nvpair id="WebServerIP_ip" name="ip" value="127.0.0.26"/>
<nvpair id="WebServerIP_nic" name="nic" value="eth0"/>
</attributes>
</instance_attributes>
</primitive>'
To remove all instance_attributes:
cibadmin -D -o resources -X '<primitive id="WebServerIP">
<instance_attributes/>
</primitive>'
Or, to remove the whole resource, one would run this:
cibadmin -D -o resources -X '<primitive id="WebServerIP"/>'