[ClusterLabs] Antw: Re: Q: Configure date_expression rule with crm shell without using XML
Ulrich Windl
Ulrich.Windl at rz.uni-regensburg.de
Wed Sep 5 02:49:57 EDT 2018
>>> Kristoffer Grönlund <kgronlund at suse.de> schrieb am 04.09.2018 um 16:17 in
Nachricht <1536070650.9365.15.camel at suse.de>:
> On Tue, 2018‑09‑04 at 16:00 +0200, Ulrich Windl wrote:
>> Hi!
>>
>> I have a question: Can I use crm shell to configure time‑based
>> meta_attributes without using XML?
>> I tried to configure it using XML, but since then the resource
>> configuration can be displayed as XML only.
>> What I'm trying to do is to configure resource‑specific stickiness
>> based on time only, wanting to set stickiness to 0 in the evening
>> hours to allow re‑balancing resources.
>>
>
> It should be possible to do this via rule expressions in crm shell, but
> not all XML that possible is expressible via crm shell syntax.
>
> If you can show me the XML for the resource which doesn't render in crm
> shell I could probably be more specific.
>
> http://crmsh.github.io/man/#topics_Syntax_RuleExpressions
Hi Christoffer,
crmsh is so incredibly cool: I could add my changes like the following
(snipplet) withpout having to deal with XML (as presented in clusterlabs'
example "Change resource-stickiness during working hours"):
meta 1: resource-stickiness=0 \
meta 2: rule date spec hours=7-18 weekdays=1-5
resource-stickiness=1000
and that translates to
<meta_attributes score="1" id="prm-meta_attributes">
<nvpair name="resource-stickiness" value="0"
id="prm-meta_attributes-resource-stickiness"/>
</meta_attributes>
<meta_attributes score="2" id="prm-meta_attributes-0">
<rule score="INFINITY" id="prm-meta_attributes-0-rule">
<date_expression operation="date_spec"
id="prm-meta_attributes-0-rule-expression">
<date_spec hours="7-18" weekdays="1-5"
id="prm-meta_attributes-0-rule-expression-date_spec"/>
</date_expression>
</rule>
<nvpair name="resource-stickiness" value="1000"
id="prm-meta_attributes-0-resource-stickiness"/>
</meta_attributes>
Now if "show changed" could display the changes in "diff -u" or wdiff format,
it would even be cooler. Maybe create another command like "show changes" or
"show diff[erences]"... ;-)
Regards,
Ulrich
>
>> Regards,
>> Ulrich
>>
>>
>>
>> _______________________________________________
>> Users mailing list: Users at clusterlabs.org
>> https://lists.clusterlabs.org/mailman/listinfo/users
>>
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.
>> pdf
>> Bugs: http://bugs.clusterlabs.org
>>
> ‑‑
>
> Cheers,
> Kristoffer
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> 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 Users
mailing list