Dev: ui_resource: Give warning start/stop/restart if "is-managed" or "maintenance" get detected - #859
Conversation
zzhou1
left a comment
There was a problem hiding this comment.
The code is incomplete since the maintenance mode has 3 different levels: cluster/node/resource.
e7bdd8b to
90a3b6b
Compare
90a3b6b to
459941e
Compare
6ae82bf to
0f77bd9
Compare
zzhou1
left a comment
There was a problem hiding this comment.
please tweak the title, something like,
Dev: ui_resource: reject start/stop/restart if "is-managed" or "maintenance" get detected
| """ | ||
| return all([self.is_node_in_maintenance(node) for node in self.list_nodes()]) | ||
|
|
||
| def is_node_running_resource_in_maintenance(self, rsc_id): |
There was a problem hiding this comment.
How about,
s/is_node_running_resource_in_maintenance/is_node_in_maintenance_for_the_running_resource/
| # then check the rsc maintenance meta attribute | ||
| attr = get_attr_value(rsc_meta_node, "maintenance") | ||
| if attr and is_xs_boolean_true(attr): | ||
| return False, "resource \"{}\" is in maintenance".format(ident) |
There was a problem hiding this comment.
The above "maintenance" checks are not the scope of is_managed(). Since, "maintenance" and "is-managed" are two different terminologies and not fit into the current function name itself all together. I'm thinking their function names something like,
is_managed(rsc)
is_maintenance(rsc)
is_managed_or_maintenance(rsc)
There was a problem hiding this comment.
From display of crm_mon, pacemaker show both situations as unmanaged for the resource
How about change the function name as is_managed_or_maintenance?
| for rsc in resources: | ||
| rc, reason = xmlutil.RscState().is_managed(rsc) | ||
| if not rc: | ||
| context.error("Resource {} is unmanaged ({})".format(rsc, reason)) |
There was a problem hiding this comment.
Confusing terminology here, since "unmanaged" does not match to the fact when the "maintenance" mode is true.
There was a problem hiding this comment.
@zzhou1 From the display of crm_mon, both maintenance and is-manage=false situation, the resource status always show unmanaged
0f77bd9 to
ae0b247
Compare
ae0b247 to
058875f
Compare
It should better to give warning when start/stop/restart a RA while this RA is in
unmanagedmodeAdd checking items in
is_managed:Example: