This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

Homepage

About Us

Contact Us

Legal Info

How To Contribute

Security Issues

21 December 2007 Heartbeat release 2.1.3 is now out Download it and install it!

11 October 2007 NEW educational HA/DR Blog hosted by Alan Robertson

9 April 2007 Check out the Cool Heartbeat Screencasts: Installation, Intro to the GUI Part of the Heartbeat Education project

Last site update:
2008-05-12 06:43:15

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"/>'

See Also

v2/Examples/Simple, v2/Examples/Advanced