[ClusterLabs] Resource creation fails

Ken Gaillot kgaillot at redhat.com
Tue Mar 22 14:37:22 UTC 2016


On 03/22/2016 07:37 AM, Nagorny, Dimitry wrote:
> Hi,
> 
> Forgot to attach the file, sorry.
> 
> 
> Respectfully
> Dimitry Nagorny
> Trainee
> 
> Von: Nagorny, Dimitry [mailto:dimitry.nagorny at robot5.de]
> Gesendet: Dienstag, 22. März 2016 13:32
> An: users at clusterlabs.org
> Betreff: [ClusterLabs] Resource creation fails
> 
> Good afternoon all,
> 
> My setup is that I have successfully running two CentOS 7.2 Server nodes in a pacemaker cluster with failover on a virtual IP. Both Servers act as OpenSIPS. I wrote my own ocf script to surveil that the opensips pid is still there so I can assume opensips is still running (very basic but its all I want for the moment).
> 
> My problem: If I want to create the resource I am getting messages that I can't interpret and can't find anything about it with the help of google:
> 
> Traceback (most recent call last):
>   File "/usr/sbin/pcs", line 219, in <module>
>     main(sys.argv[1:])
>   File "/usr/sbin/pcs", line 159, in main
>     cmd_map[command](argv)
>   File "/usr/lib/python2.7/site-packages/pcs/resource.py", line 42, in resource_cmd
>     resource_create(res_id, res_type, ra_values, op_values, meta_values, clone_opts)
>   File "/usr/lib/python2.7/site-packages/pcs/resource.py", line 538, in resource_create
>     bad_opts, missing_req_opts = utils.validInstanceAttributes(ra_id, params , get_full_ra_type(ra_type, True))
>   File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 1770, in validInstanceAttributes
>     for action in actions.findall("parameter"):
> AttributeError: 'NoneType' object has no attribute 'findall'
> 
> I get this after entering: pcs resource create opensips ocf:opensips:opensips op monitor interval=15s
> The ocf is stored in /usr/lib/ocf/resource.d/opensips/opensips.
> Please find attached the ocf script. If anything else is needed please ask.
> 
> 
> 1.       What wants the traceback tell me?

It indicates a bug in pcs, most likely in response to unexpected
behavior from the resource agent.

> 2.       Is there any way to check the ocf on centOS7? ocf-tester is not available.

I'm not sure why it isn't, maybe something distro-specific in it, but it
would be nice. However you can test it like this:

OCF_ROOT=/usr/lib/ocf [OCF_RESKEY_<param>=<value> ...] /path/to/agent
$ACTION

where the param/value pairs are whatever parameters the agent accepts
and $ACTION is whatever action you want to test.

> 3.       Any hint on how to solve this?

The major things that jump out at me in your agent:
* missing a <parameters> section (I'm not sure, but it may be required,
even if empty)
* missing the validate-all command (I believe it is required, even if it
does nothing)
* start action must check whether the process is already running, and
return success if so
* making stop do nothing seems like a bad idea to me
* monitor must distinguish between cleanly stopped (OCF_NOT_RUNNING) and
failed/unknown (OCF_ERR_GENERIC)

> 
> Very Respectfully
> Dimitry Nagorny
> Trainee





More information about the Users mailing list