Mailing List Archive

Clear target-role attributes for sub-resources
Hi @all,

I received a question from my customer which I couln't answer, yet.
Maybe someone here could give me an explanation or a hint on this:

Imagine a simple resource like

-----
primitive pri_svc_apache lsb:apache2 \
operations $id="pri_svc_apache-operations" \
op monitor interval="30" on-fail="restart" timeout="20s"
-----

As the system goes along, this resource might get stopped and started again.
Once the target-role changes the first time, the target-role meta is added:

-----
primitive pri_svc_apache lsb:apache2 \
operations $id="pri_svc_apache-operations" \
op monitor interval="30" on-fail="restart" timeout="20s" \
meta target-role="Started"
-----

Is there a way to automatically remove these kind of attributes if
they're equal to the cluster defaults?
The problem here is that this resource might belong to a simple group:

-----
group grp_apache pri_svc_apache
-----

Normally, "crm resource stop grp_apache" would set the group's target-role
to Stopped and would also stop the child resource. But if the primitive has
a hard-coded target-role, this command results in a warning which requires
user-interaction:

-----
Do you want to override target-role for child resource pri_svc_apache?
-----

This behavior leads to difficulties if the crm commands are used within
scripts that do some magic things and also execute starts and stops of resources.
"crm -F" or "crm --force" don't help here.

Instead of manually cleaning up redundant resource attributes, it would be great
to have a method for ignoring the kind of messages.

On the other hand there may be comprehensible reasons for this,
but I currently can't guess them.

Could someone please point me in the right direction?


Thanks in advance!
Thomas


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: Clear target-role attributes for sub-resources [ In reply to ]
Hi,

On Mon, 10 Mar 2014 14:44:14 +0000
"Thomas Schulte" <tschulte@novell.com> wrote:

> Normally, "crm resource stop grp_apache" would set the group's
> target-role to Stopped and would also stop the child resource. But if
> the primitive has a hard-coded target-role, this command results in a
> warning which requires user-interaction:
>
> -----
> Do you want to override target-role for child resource pri_svc_apache?
> -----
>
> This behavior leads to difficulties if the crm commands are used
> within scripts that do some magic things and also execute starts and
> stops of resources. "crm -F" or "crm --force" don't help here.
>
> Instead of manually cleaning up redundant resource attributes, it
> would be great to have a method for ignoring the kind of messages.
>

Normally, cmrsh should detect that it is being used non-interactively
and suppress any prompts. It sounds like there is a bug in crmsh in
this case.

Could you please file an issue[1] and include information about the
version of crmsh you are using, and any other details that might help
in locating the problem?
Thank you!

[1]: https://savannah.nongnu.org/bugs/?group=crmsh

> On the other hand there may be comprehensible reasons for this,
> but I currently can't guess them.
>
> Could someone please point me in the right direction?


--
// Kristoffer Grönlund
// kgronlund@suse.com
_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems