Bug 1173942

Summary: Allow for listing configured actions per particular resources
Product: Red Hat Enterprise Linux 6 Reporter: Piyush Sharma <pisharma>
Component: luciAssignee: Jan Pokorný [poki] <jpokorny>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact: Steven J. Levine <slevine>
Priority: unspecified    
Version: 6.5CC: cfeist, cluster-maint, jpokorny, jruemker, rmccabe, rsteiger, tlavigne
Target Milestone: rcKeywords: EasyFix, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: luci-0.26.0-93.el6 Doc Type: Enhancement
Doc Text:
*luci* now lists explicit configured actions for individual resources In a cluster configuration, it is useful to be able to review configured actions for given resources. This may be particularly useful when verifying that the implicit operations, such as the `depth` parameter of the `status` action, are overwritten with user configuration. More generally, being able to review configured actions can show the affect that these modifications and additions to implicit actions have on current cluster behavior. *luci* now lists configured actions per individual resources in the *Service Groups* breakdown view, showing which parameters are disregarded for particular actions and emphasizing timeouts if they are set as enforced. Note that the view does not allow for active modifications of the actions; to modify the actions, you use the `--addaction` and `--rmaction` parameters of the *ccs* CLI tool.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 11:38:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1272587, 1272588    
Attachments:
Description Flags
error's snapshot none

Description Piyush Sharma 2014-12-14 10:16:22 UTC
Created attachment 968421 [details]
error's snapshot

Description of problem:

While accessing "service group" in luci management tool, we are getting following error messages :


11:04:40,114 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
11:10:25,148 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
11:10:35,700 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
11:10:44,189 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
11:14:03,052 INFO  [luci.controllers.cluster] User "root" Created cluster service "LASTLOGIN-RG" in cluster "service-clu2"
11:14:07,712 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
11:16:45,531 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
14:09:41,680 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
14:09:42,085 INFO  [paste.httpserver.ThreadPool] kill_hung_threads status: 10 threads (0 working, 10 idle, 0 starting) ave time N/A, max time 0.00sec, killed 0 workers
14:09:56,724 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
14:12:26,899 INFO  [luci.controllers.cluster] User "root" Edited cluster service "LASTLOGIN-RG" in cluster "service-clu2"
14:12:31,364 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
14:12:39,835 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
/usr/lib/python2.6/site-packages/tw/core/view.py:223: DeprecationWarning: object.__new__() takes no parameters
  obj = object.__new__(cls, *args, **kw)
/usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:230: SAWarning: Unicode type received non-unicode bind param value 'create_cluster'
  param.append(processors[key](compiled_params[key]))
/usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:230: SAWarning: Unicode type received non-unicode bind param value 'import_cluster'
  param.append(processors[key](compiled_params[key]))
Starting server in PID 37847.
serving on 0.0.0.0:8084 view at https://127.0.0.1:8084
/usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:230: SAWarning: Unicode type received non-unicode bind param value 'iannuari'
  param.append(processors[key](compiled_params[key]))
15:49:39,195 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action
15:50:11,436 ERROR [luci.lib.ClusterConf.ModelBuilder] Error parsing cluster.conf XML: Expecting a resource element, got action



Version-Release number of selected component (if applicable):

luci-0.26.0-48.el6.x86_64 

But also tried with latest version of luci.

luci-0.26.0-63.el6.x86_64


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Jan Pokorný [poki] 2014-12-16 14:44:40 UTC
To be noted:
"EasyFix" applies only for "do not understand, but accept" mode of dealing
with <action> stanzas under <rm> tag.  This will not enable one to actively
manipulate with <action> settings, which seems significantly more complex
and should be a subject of another bug if really needed.

Comment 4 Jan Pokorný [poki] 2014-12-16 15:49:19 UTC
OK, it was found out that actually this is not luci's fault but rather
problem with improper cluster schema (cluster.rng) possibly confusing the
users [bug 1044048 comment 7] (/cluster/rm/resources/action -> wrong).

Comment 8 John Ruemker 2015-10-20 17:01:48 UTC
(In reply to Jan Pokorný from comment #4)
> OK, it was found out that actually this is not luci's fault but rather
> problem with improper cluster schema (cluster.rng) possibly confusing the
> users [bug 1044048 comment 7] (/cluster/rm/resources/action -> wrong).

Is that to say that nothing is needed here? Looks like the customer case is closed, so they don't seem to be awaiting any fix here.  If you think this was the cause of the problem, we can probably close this out.

-John

Comment 10 John Ruemker 2016-08-02 20:06:51 UTC
I'm going to close this out as there is no longer a customer interest driving it at this point.

Comment 11 Jan Pokorný [poki] 2016-08-24 21:10:06 UTC
Let's keep this bug opened; nice to have fixed at least in terms of
generic acceptance of respectice config on luci side.

Comment 12 Jan Pokorný [poki] 2016-11-11 17:49:27 UTC
Finally got to re-grasp what's going on in this bug.
In fact luci behaved correctly in the reported case, but there
is quite a lack of support for configured actions per resource,
and also the SanityCheck method of BaseResource was actively
preventing proper handling of existing actions.

So the scope of this bug is slightly shifted, which is also
reflected in the changed summary.

Comment 17 Jan Pokorný [poki] 2017-01-11 20:55:23 UTC
Couple of observations partially arising from experiments with
ccs_flatten executable from clufter package, for which I would note
that:
- it's intentionally hidden from PATH resolution as it's mere
  internal part of wider filter chain processing, hence
  one has to find it first (rpm -ql python-clufter | grep flatten)
- it shares the exact parsing/tree flattening logic with rgmanager
  as it uses the very same (or just slightly modified) respective
  sources

Observations:
1a. "depth" is only relevant for status/monitor
   (i.e. explicitly disregarded for operations:
   start, stop, reconfig, migrate, recover, reload, ...):
   https://git.fedorahosted.org/cgit/cluster.git/tree/rgmanager/src/daemons/reslist.c?h=cluster-3.2.0#n709
   https://git.fedorahosted.org/cgit/cluster.git/tree/rgmanager/src/daemons/resrules.c?h=cluster-3.2.0#n435

1b. "interval" is only relevant for status:
   https://git.fedorahosted.org/cgit/cluster.git/tree/rgmanager/src/daemons/restree.c?h=cluster-3.2.0#n1259
   (not even for monitor, as this actions is never called by rgmanager
    anyway: https://fedorahosted.org/cluster/wiki/ResourceActions#monitorvs.status)

2. every "action" propagation works as expected except for
   those under resource reference, these are disregarded,
   as also documented:
   https://fedorahosted.org/cluster/wiki/ResourceActions#CustomizingActions

3. actions as children of <service> really does not make
   any sense:
   https://github.com/ClusterLabs/resource-agents/blob/v3.9.7/rgmanager/src/resources/service.sh#L225

Validations:
- observation wrt. "A resource referenced from service group"
  in [comment 15] appears correct

Action points:
A. filter "monitor" and "metadata" actions out of the picture
   (former because of being unused, latter because of tweaking
    or inspecting timeouts etc. is worthless)
B. show timeouts in bold if respective __enforce_timeouts
   parameter encodes positive integer of "yes", otherwise they
   are only optional hints to the resource agent in question:
   https://fedorahosted.org/cluster/wiki/ResourceActions#UsingActionTimeouts
   https://git.fedorahosted.org/cgit/cluster.git/tree/rgmanager/src/daemons/restree.c?h=cluster-3.2.0#n672
C. based on 1a. + 1b., do not render anything (or something indicating
   "not applicable") for non-fitting depth/interval parameters
   (after filtering "monitor" out per A.)

Comment 18 Jan Pokorný [poki] 2017-01-12 20:27:05 UTC
Re B. from [comment 17]:
__enforce_timeouts (meta) attribute has to be defined at proper
resource (incl. reference) under <service>, those defined at
the reference target (under <resources>) are disregarded.

I painfully discovered that through ccs_flatten, as it actually
contained a bug and exposing that flag had to be enabled first;
both relevant commits:
https://pagure.io/clufter/c/2660de5aac12e1104bc15aecbfddd26dbbb85d34?branch=next
https://pagure.io/clufter/c/853f4040c35ed755e2e16505cefbdd2498ee04be?branch=next

Comment 21 Jan Pokorný [poki] 2017-02-08 17:50:25 UTC
Resolution of this bug dedicated to Piyush Sharma who reported it.

Comment 22 Steven J. Levine 2017-02-09 18:38:08 UTC
I did a little bit of streamlining to the doc text and tried not to change any meanings -- although I was a little unsure about what was really meant by "clues" as to which parameters are disregarded.

Comment 24 errata-xmlrpc 2017-03-21 11:38:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0766.html