Correct use of Pacemaker’s ocf-tester with OCF resource agents

drbdlinux-hapacemaker

I have got a setup with DRBD, Corosync, and Pacemaker in which Pacemaker should mount a file system atop a DRBD block device on different cluster nodes, depending on nodes' availabilies. The setup is not yet fully working, therefore I try testing Pacemaker's resource agent for DRBD, ocf::linbit:drbd, with ocf-tester.

If I try like so (drbd_res is the name of the DRBD resource in Pacemaker; r1 is the name of the resource in /etc/drbd.conf)

sudo ocf-tester -n drbd_res -o drbd_resource="r1"\
    /usr/lib/ocf/resource.d/linbit/drbd monitor

I get this error message:

Beginning tests for /usr/lib/ocf/resource.d/linbit/drbd...
/usr/sbin/ocf-tester: 226: /usr/sbin/ocf-tester: xmllint: not found
* rc=127: Your agent produces meta-data which does not conform to ra-api-1.dtd
* rc=6: Validation failed.  Did you supply enough options with -o ?
WARNING: You may be disappointed: This RA is intended for pacemaker
1.0 or better! 
ERROR: meta parameter misconfigured, expected clone-max -le 2, but found unset. 
Aborting tests

So my question is this: How exactly can I manually invoke (i.e. test) OCF resource agents with ocf-tester? For the given example, I would expect the execution to complete with one of the prescribed return values. I am using DRBD 8.4.3 and Pacemaker 1.1.16 on Debian.

Best Answer

Your error tells:

Beginning tests for /usr/lib/ocf/resource.d/linbit/drbd...
/usr/sbin/ocf-tester: 226: /usr/sbin/ocf-tester: xmllint: not found

It doesn't have xmllint to test the agent, so first install it using: apt-get install libxml2-utils

Then it should work fine. Hope is helps. :) All the best. :)