[Pacemaker] Re: [Linux-HA] the crm command line interface

Serge Dubrouski sergeyfd at gmail.com
Fri Sep 5 12:54:01 EDT 2008


On Fri, Sep 5, 2008 at 10:38 AM, Dejan Muhamedagic <dejanmm at fastmail.fm> wrote:
> Hi Serge,
>
> On Fri, Sep 05, 2008 at 09:42:41AM -0600, Serge Dubrouski wrote:
>> Hello -
>>
>> It's a really great tool. Great job!
>
> Thanks.
>
>> Here are my expirience
>> (pacemaker-0.6.5-2.2 + Heartbeat 2.1.3-23.1:
>>
>> Nodes.
>>
>> 1. Status and Show Node show the exactly the same information. Even
>> when you provide node name in show command it shows all nodes. Is it
>> supposed so?
>
> No. Actually, I'm looking for input here. Don't exactly know
> what's interesting for users. There are two kinds of information:
> provided by the CIB (node type and node attributes) and by
> crmadmin (if the node's online and if it is DC).
>
>> cib.
>>
>> Couldn't test it because crm_shadow wasn't found. Looks like it's a new tool.
>
> Yes. That's a very useful new thing provided by Andrew. It
> basically allows you to test the configuration out of the
> cluster.
>
>> Resource.
>>
>> 1. Status without parameters shows a list of resources but doesn't
>> show the real status of them onlinr/stopped.
>
> Hmm. Strange. Here it says:
>
> crm(live)# resource status
> Resource Group: g1
>    ip2 (ocf::heartbeat:IPaddr) Started

Here is what it says here:

Clone Set: DoFencing
    child_DoFencing:0   (stonith:external/xen0)
    child_DoFencing:1   (stonith:external/xen0)
Master/Slave Set: ms-drbd0
    drbd0:0     (ocf::heartbeat:drbd)
    drbd0:1     (ocf::heartbeat:drbd)
Resource Group: myGroup
    myIP        (ocf::heartbeat:IPaddr)
    fs0 (ocf::heartbeat:Filesystem)
    myPgsql     (ocf::heartbeat:pgsql)

And when I stop a resource it shows the same. But that's probably
because I have 0.6.5.
>
>> 2. It's not clear how to migrate a resource to a specific node it it's
>> possible at all.
>
> The help is still lacking. You can do migrate:
>
> resource migrate rsc node
> or
> resource migrate rsc
>
>> 3. It would be good if param resource show was able to show all
>> parameters for a given resource.
>>
>> 4. Again would be good failcount resource was able to show failcounts
>> for all nodes
>
> I'll see if I can implement that. Though that kind of stuff
> should be done at the configure level:
>
> configure show rsc
>
>> Configure.
>>
>> ERROR: CIB release '2.1' is not supported
>> ERROR: bad cib
>
> Unfortunately, the CIB syntax changed, so the program supports
> only the one which will be in pacemaker 1.0 (now: 0.7). It's a
> pity because this part is the most interesting.
>
>> Will try this part later when I upgrade it to the latest version,
>> though I think that you shall consider support for old releases as
>> well.
>
> I am. Though I'm rather low on time resources.
>
>> Options.
>>
>> 1. Help message for skill-level command doesn't say what are possible
>> options. Entering "skill-level high" crashes the program:
>
> Just did an update: if you type a command without args or too
> many args, it should print usage.
>
>> Traceback (most recent call last):
>>   File "./crm", line 3117, in <module>
>>     parse_line(levels,shlex.split(inp))
>>   File "./crm", line 3037, in parse_line
>>     rv = d() # execute the command
>>   File "./crm", line 3036, in <lambda>
>>     d = lambda: cmd[0](*args)
>>   File "./crm", line 255, in set_skill_level
>>     if skill_level in skill_levels:
>> NameError: global name 'skill_levels' is not defined
>
> Fixed.
>
> Did I mention that it is most probably full of bugs :)
>
>> 2. pager/editor/skill-level/user commands without parameters should
>> show current values.
>
> Right. That interface was done too hastily. It should perhaps
> follow something like:
>
> set param value
> show param
>
>> Thanks for the great job!
>
> You're welcome.
>
> Cheers,
>
> Dejan
>
>> Serge.
>>
>>
>>
>> On Fri, Sep 5, 2008 at 8:59 AM, Dejan Muhamedagic <dejanmm at fastmail.fm> wrote:
>> > Hi,
>> >
>> > Can't read XML? Then this may be something for you...
>> >
>> > For some time the command line interface for the CRM/Pacemaker
>> > has been in the works. About one month ago I posted a draft
>> > specification and user guide to the development list. There was
>> > no response, so I assumed that everybody was happy with it ;-)
>> >
>> > As I got better grip on how the program could be used, the
>> > specification changed accordingly during the development.
>> >
>> > The first release is already in the Pacemaker's development
>> > repository. You can get it here:
>> >
>> > http://hg.clusterlabs.org/pacemaker/dev/raw-file/tip/tools/crm.in
>> >
>> > To run it, first replace @HA_VARLIBDIR@ with /var/lib or wherever
>> > heartbeat/crm lives. Or compile and install the latest pacemaker
>> > code. Andrew will probably soon make new rpms.
>> >
>> > The source of the current documentation:
>> >
>> > http://hg.clusterlabs.org/pacemaker/dev/raw-file/tip/doc/crm_cli.txt
>> >
>> > It is readable, but to produce an esthetically more pleasing
>> > document, just process it with asciidoc to get PDF or HTML.
>> >
>> > CLI consists of two main parts: the management (resource
>> > start/stop, node standby, and similar) and the configuration
>> > part. There is a (very) small language with which it is possible
>> > to specify the cluster configuration. This description is then
>> > translated by the CLI into an XML which the CRM understands.
>> >
>> > The management may be used with all versions of heartbeat
>> > v2/pacemaker, as it is using the external tools such as
>> > crm_resource.
>> >
>> > The configuration part supports only the development version of
>> > Pacemaker, i.e. it won't work with Pacemaker 0.6.x or Heartbeat
>> > 2.1.x versions. If there's a too big an outcry, I may consider
>> > fixing it to support the older releases as well.
>> >
>> > To start using it, read the document. If you can't (as most of
>> > you probably won't), just start the program (type crm) and try to
>> > manage with help.
>> >
>> > Some things are not implemented yet, but should be there soon
>> > enough:
>> >
>> > - tab completion (this seems to me very important, so it is the
>> >  first on the list)
>> > - configuring cluster properties (crm_config)
>> > - the "slow" resource configuration (the "enter" command)
>> >
>> > Suggestions are, as always, very welcome. If you have a good idea
>> > on how to improve the usability, I'm all ears.
>> >
>> > Thanks,
>> >
>> > Dejan
>> > _______________________________________________
>> > Linux-HA mailing list
>> > Linux-HA at lists.linux-ha.org
>> > http://lists.linux-ha.org/mailman/listinfo/linux-ha
>> > See also: http://linux-ha.org/ReportingProblems
>> >
>>
>>
>>
>> --
>> Serge Dubrouski.
>>
>> _______________________________________________
>> Pacemaker mailing list
>> Pacemaker at clusterlabs.org
>> http://list.clusterlabs.org/mailman/listinfo/pacemaker
>
> _______________________________________________
> Pacemaker mailing list
> Pacemaker at clusterlabs.org
> http://list.clusterlabs.org/mailman/listinfo/pacemaker
>



-- 
Serge Dubrouski.




More information about the Pacemaker mailing list