Get used to the cibadmin command. Since you are not supposed to modify the actual cib.xml file, you need to use the cibadmin command to modify it. cibadmin --help with give you a list of options, here are the basic ones you really need to know:
-C = Create
-U = Update
-E = Erase
-Q = Query
To get that first resource running, you need to create an xml file. The one I use for a cluster managed IP address looks simply like this:
<primitive id="IP-1-15" class="ocf" type="IPaddr" provider="heartbeat">
<instance_attributes id="IP-1-15-I"$gt;
<attributes>
<nvpair id="ip1" name="ip" value="192.168.1.15" />
</attributes>
</instance_attributes>
</primitive>
One very important thing to keep in mind is nvpair id="ip1". This has to be unique throughout the configuration, otherwise it won't load. Save the files as myip.xml (name it whatever you want).
To load this into your config, you just run this command:
cibadmin -C -o resources -x /etc/ha.d/myip.xml
That means we want to -C create this -o resource resource from -x myip.xml xml file.
If you check your cluster with crm_mon you should see your new IP address.
Now let's say you want to add monitoring to that resource. You just add that section in the xml file like this:
<primitive id="IP-1-15" class="ocf" type="IPaddr" provider="heartbeat">
<operations>
<op id="1" name="monitor" interval="5s" timeout="3s" />
</operations>
<instance_attributes id="IP-1-15-I">
<attributes>
<nvpair id="ip1" name="ip" value="192.168.1.15" />
</attributes>
</instance_attributes>
</primitive>
And then update the cib like this:
cibadmin -U -o resources -x /etc/ha.d/myip.xml
