CIBADMIN(8)

NAME
cibadmin - read, modify, or administer heartbeat Cluster Information Base

SYNOPSIS
cibadmin (--cib_query|-Q) -[Vrwlsmfbp] [-i xml-object-id|-o xml-object-type] [-t t-flag-whatever] [-h hostname]

cibadmin (--cib_create|-C) -[Vrwlsmfbp] [-X xml-string] [-x xml-filename] [-t t-flag-whatever] [-h hostname]

cibadmin (--cib_replace-R) -[Vrwlsmfbp] [-i xml-object-id|-o xml-object-type] [-X xml-string] [-x xml-filename] [-t t-flag-whatever] [-h hostname]

cibadmin (--cib_update|-U) -[Vrwlsmfbp] [-i xml-object-id|-o xml-object-type] [-X xml-string] [-x xml-filename] [-t t-flag-whatever] [-h hostname]

cibadmin (--cib_modify|-M) -[Vrwlsmfbp] [-i xml-object-id|-o xml-object-type] [-X xml-string] [-x xml-filename] [-t t-flag-whatever] [-h hostname]

cibadmin (--cib_delete|-D) -[Vrwlsmfbp] [-i xml-object-id|-o xml-object-type] [-t t-flag-whatever] [-h hostname]

cibadmin (--cib_delete_alt|-d) -[Vrwlsmfbp] -o xml-object-type [-X xml-string|-x xml-filename] [-t t-flag-whatever] [-h hostname]

cibadmin --cib_erase (-E)

cibadmin --cib_bump (-B)

cibadmin --cib_ismaster (-m)

cibadmin --cib_master (-w)

cibadmin --cib_slave (-r)

cibadmin --cib_sync (-S)

cibadmin --cib_help (-?)

DESCRIPTION
Cibadmin is the primary administrative command for manipulating the heartbeat CIB. It can be used to dump all or part of the CIB, to update all or part of it to modify all or part of it, to delete the entire CIB, or to perform miscellaneous CIB administrative operations. Cibadmin operates on the XML trees of the CIB, largely without knowledge of the meaning of the updates or queries being performed. This means that shortcuts that seem natural to humans who understand the meaning of the elements in the XML tree are impossible to use with cibadmin - which requires a complete lack of ambiguity, and can only deal with valid XML subtrees (tags/elements) - both on input and output.

OPTIONS

--id (-i) xml-object-id
    the XML id of the XML object being operated on. This option is deprecated, and may go away in future versions of cibadmin.

--obj_type (-o) object-type
    the type of object being operated on. Valid values are nodes, resources, status, constraints

--verbose (-V)
    turn on debug mode. Additional -V options increase the verbosity of the output.

--help (-?)
    obtain a help message from the cibadmin.

--cib_erase (-E)
    Erase the contents of the whole CIB.

--cib_query (-Q)
    Query a portion of the CIB.

--cib_create (-C)
    Create a new CIB from the argument XML content.

--cib_replace (-R)
    Recursively replace an XML object in the CIB.

--cib_update (-U)
    Recursively update an object in the CIB. Updating an object replaces like members in the XML, but does not delete attributes not mentioned.

--cib_modify (-M)
    Modify the attributes of an object in the CIB. Object to be modified must be specified with a --id option.

--cib_delete (-D)
    Delete the first object matching the specified criteria. e.g., <tagname 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 the specified fully qualified location. e.g., <resource id="rsc1"><operations><op id="rsc1_op1"/>... Requires -o type option.

--cib_ismaster (-m)
    Print a message indicating whether or not the local instance of the CIB software is the master instance or not. Exits with return code 0 if it is the master instance, or 35 otherwise.

--cib_sync (-S)
    Force a full sync of the local CIB against the master CIB. (or does this force all slave copies to be updated?).

--crm_xml (-X) xml-fragment-string
    specifies an XML tag or fragment on the command line for crmadmin to operate on. Note that it must be a complete tag or XML fragment.

--xml-file (-x) filename
    specifies XML in a file for cibadmin to operate on. Note that it must be a complete tag or XML fragment.

--xml_pipe (-p)
    specifies that the XML for cibadmin to operate on will come from standard input. Note that it must be a complete tag or XML fragment.

SPECIALIZED OPTIONS

--cib_bump (-B)
    This forcibly increases the update counter of the CIB.

--cib_master (-w)
    This command forces the local CIB instance into read-write mode. This is a highly dangerous command.

--cib_slave (-r)
    This command forces the local CIB instance into read-only mode. This is a highly dangerous command.

--force_quorum (-f)
    This will force a write to the CIB, regardless of whether the cluster has quorum or not. Use carefully.

--host (-h) hostname
    specifies the host to send this command to (rarely used, advanced option)

--local (-l)
    command takes effect locally (rarely used, advanced option)

--no-bcast (-b)
    Command will not be broadcast to other nodes, even if it modifies the CIB. This is a fairly dangerous, rarely used advanced option.

--sync-call (-s)
    Wait for the operation given to cibadmin to complete before exiting.

EXAMPLES
Need to put a few real examples here... To get a copy of the entire active CIB (including status section, etc.) delivered to stdout, issue this command:
    cibadmin -Q

To get a copy of the status section (only) delivered to stdout, issue this command:
    cibadmin -Q --obj_type status

To add an IPaddr2 resource to the resources section, first create a file foo with the following contents:
    <primitive id="R_10.10.10.101" class="ocf" type="IPaddr2"
     provider="heartbeat">
     <instance_attributes id="RA_R_10.10.10.101">
      <attributes>
       <nvpair id="R_ip_P_ip" name="ip" value="10.10.10.101"/>
       <nvpair id="R_ip_P_nic" name="nic" value="eth0"/>
      </attributes>
     </instance_attributes>
    </primitive>
Then, issue the following command:
    cibadmin --obj_type resources -U -x foo

To change the IP address of the IPaddr2 resource previously added, issue the command below:
    cibadmin --id R_10.10.10.101 -M -X '<nvpair id="R_ip_P_ip" name="ip" value="10.10.10.102"/>'
Note: This does not change the resource name to match the new IP address. To do that you have to delete and re-add the resource with a new id tag.

To stop (disable) the IP address resource added previously without removing it, create a file called ''bar'' with the following content in it:
    <primitive id="R_10.10.10.101">
     <instance_attributes id="RA_R_10.10.10.101">
      <attributes>
       <nvpair id="stop_R_10.10.10.101" name="target_role" value="Stopped"/>
      </attributes>
     </instance_attributes>
    </primitive>
Then issue the following command:
    cibadmin --obj_type resources -U -x bar

To restart the IP address resource stopped by the previous step, issue the command below:
    cibadmin -D -X '<nvpair id="stop_R_10.10.10.101">'

To completely remove the IP address resource from the CIB which was added earlier, issue the command below:
    cibadmin -D -X '<primitive id="R_10.10.10.101"/>'

To replace the CIB with a new hand-edited version of the CIB, issue the following command
    cibadmin -R -x $HOME/cib.xml
NOTE: you should not edit the cib.xml file in place, but edit a copy of it, since it is frequently updated by the CIB at unpredictable times.

FILES
@CRM_CONFIG_DIR@/cib.xml - the CIB (minus status section) on disk.

SEE ALSO
crm_resource(8), crmadmin(8), lrmadmin(8), heartbeat(8)

AUTHOR
cibadmin was written by Andrew Beekhof.

This manual page was originally written by Alan Robertson.

CAVEATS
cibadmin is perfectly willing to completely mangle your CIB if you ask it reasonably nicely.

Because the CIB is updated continually as things change in the cluster, relying on using the automatically maintained previous copy of the CIB on disk as a backup is likely to be a dissapointing experience.

BUGS
Note carefully the long options. Some have - characters in them, and some have _ characters in them. What does the -t xxx flag do?