[Pacemaker] crmsh resource update issue
Andrew Beekhof
andrew at beekhof.net
Tue Oct 2 22:53:31 UTC 2012
On 03/10/2012, at 6:26 AM, Vladislav Bogdanov <bubble at hoster-ok.com> wrote:
> 02.10.2012 17:40, Dejan Muhamedagic wrote:
> ...
>>> One more patch to fix lrmadmin disfunction with 1.1.8.
>>
>> But this fixes support for RH fence-agents, if I'm not wrong.
>
> Yes btw.
>
>>
>>> It is a little bit intrusive, but I'm definitely not a python coder :)
>>
>> That's no problem.
>>
>>> You can just take it as a reference.
>>
>> Definitely useful. Thanks!
>>
>>> diff -urNp a/modules/ra.py b/modules/ra.py
>>> --- a/modules/ra.py 2012-09-13 12:47:48.000000000 +0000
>>> +++ b/modules/ra.py 2012-09-27 08:01:19.965097194 +0000
>>> @@ -76,7 +70,10 @@ class RaOS(object):
>>> l = stdout2list("%s/resource.d/%s/%s meta-data" % \
>>> (os.environ["OCF_ROOT"],ra_provider,ra_type))
>>> elif ra_class == "stonith":
>>> - l = stdout2list("stonith -m -t %s" % ra_type)
>>> + if ra_type.startswith("fence_") and os.path.exists("/usr/sbin/%s" % ra_type):
>>> + l = stdout2list("/usr/sbin/%s -o metadata" % ra_type)
>>> + else:
>>> + l = stdout2list("stonith -m -t %s" % ra_type)
>>
>>> return l
>>> def providers(self, ra_type,ra_class = "ocf"):
>>> 'List of providers for a class:type.'
>>> @@ -97,8 +103,13 @@ class RaOS(object):
>>> l = os_types_list("/etc/init.d/*")
>>> elif ra_class == "stonith":
>>> l = stdout2list("stonith -L")
>>> + l.extend(os_types_list("/usr/sbin/fence_*"))
>>> l = list(set(l))
>>> l.sort()
>>> + if ra_class == "stonith":
>>> + for ra in ("fence_ack_manual", "fence_pcmk", "fence_legacy"):
>>> + if l.count(ra):
>>> + l.remove(ra)
>>> return l
>>>
>>> def can_use_lrmadmin():
>>> @@ -114,10 +124,8 @@ def can_use_lrmadmin():
>>> def ra_if():
>>> if vars.ra_if:
>>> return vars.ra_if
>>> - if can_use_lrmadmin():
>>> - vars.ra_if = RaLrmd()
>>
>> There's actually a point in using lrmadmin/lrmd because lrmd used
>> to provide the meta-data for lsb class.
>
> Except with 1.1.8, lrmadmin (if it exists) cannot connect to lrmd, so
> can_use_lrmadmin() actually lies here as it just tests lrmadmin
> existence and version. And IIRC logs are filled with errors.
> LSB class metadata probably needs to be reimplemented in python, as
> lrmadmin is not longer functional with 1.1.8.
>
> And I see that systemd class is not supported yet. I do not use in in
> EL6, so I won't help here. Although that should not be hard to do. One
> more point to move everything to python - glue's lrmd does not support
> it either.
>
> At the other hand, it would be nice to get all that from the new lrmd,
> so both pacemaker and shell can use one consistent source of data.
>
> David, is it possible to do?
Do you mean get the LSB and/or systemd metadata from the new lrmd?
That should work already.
>
> Best,
> Vladislav
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
More information about the Pacemaker
mailing list