RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1875632 - pcs resource enable/manage should override target-role=Stopped/is-managed=false in rsc_defaults
Summary: pcs resource enable/manage should override target-role=Stopped/is-managed=fal...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.4
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-03 23:24 UTC by Reid Wahl
Modified: 2022-03-03 07:27 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-03 07:27:22 UTC
Type: Enhancement
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1748139 0 high CLOSED [RFE] crm_mon: Show "(disabled)" next to group when entire group is disabled 2023-05-20 07:40:01 UTC
Red Hat Knowledge Base (Solution) 5429811 0 None None None 2020-09-23 23:28:02 UTC

Description Reid Wahl 2020-09-03 23:24:03 UTC
Description of problem:

If target-role=Stopped in rsc_defaults, then running `pcs resource enable <rsc>` on any individual resource or group does nothing. pcs seems to make the assumption that the target-role meta attribute defaults to "Started". Rather than setting `target-role=Started` on enable, it simply unsets the target-role meta attribute.

Likewise with is-managed=false in rsc_defaults. Running `pcs resource manage <rsc>` on any individual resource or group does nothing.

This behavior seems correct when the maintenance-mode or stop-all-resource cluster property is enabled, as that is a cluster-wide setting. However, rsc_defaults are designed to work as just that -- **default** values for meta attributes. Each resource (or group, clone, etc.) should be able to override them.

Explicitly setting target-role=Started on a resource overrides a value of "Stopped" in rsc_defaults. Explicitly setting is-managed=true on a resource overrides a value of "false" in rsc_defaults.

Since we should IMO be able to override the default with `pcs resource enable/manage` (without having to manually update meta attributes), it seems that `pcs resource enable` should set target-role=Started instead of unsetting target-role, and that `pcs resource manage` should set is-managed=true instead of unsetting is-managed. Ken and I discussed this in comments 9 and 10 of BZ1748139.

However, there are some special considerations where I'm not sure what **should** happen.
  1) If a user runs `pcs resource disable <group>` and then `pcs resource enable <rsc>` on a resource within the group:
    a) Should that resource become enabled (i.e., get target-role=Started set)?
    b) Or should the preceding disable of the entire group prevent `pcs resource enable` from setting target-role=Started for any child resources, until target-role=Stopped is removed from the group's meta attributes?
       - If we go this route, we could have a --force flag that allows `pcs resource enable` to set target-role=Started for child resources.

  2) If a user runs `pcs resource enable <rsc>` on some resource within a group, and then `pcs resource disable <group>` on the group as a whole:
    a) Should every resource in the group get disabled (i.e., get target-role=Stopped set)?
    b) Or should target-role=Stopped only be set for the group itself, letting the existing target-role=Started at the resource level override it for individual resource(s)?


A related question is whether we should continue setting target-role and is-managed meta attributes only on the group element and allow children to inherit them, or set the meta attributes on the group element **and** on all child elements. This is relevant because if `pcs resource enable` (with new behavior) has previously set target-role=Started explicitly on child resources, and then we run `pcs resource disable` on the group, then all the children remain enabled unless we iterate over them and set target-role=Stopped (or unset target-role and allow them to inherit from the group).

-----

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

pcs-0.10.4-6.el8_2.1

-----

How reproducible:

Always

-----

Steps to Reproduce:

There are a number of scenarios that would need to be tested, and the expected results will depend on the details of the approach we choose (see Description). The main focus is that `pcs resource enable` should override a resource default of target-role=Stopped, and `pcs resource manage` should override a resource default of is-managed=false.

1. Create a resource called dummy.
2. Set resource defaults to disable and unmanage all resources by default.

    # pcs resource defaults target-role=Stopped
    # pcs resource defaults is-managed=false

3. Enable and manage dummy to override these defaults.

    # pcs resource enable dummy
    # pcs resource manage dummy

-----

Actual results:

dummy remains disabled and unmanaged.

-----

Expected results:

dummy becomes enabled and managed.

Comment 1 Reid Wahl 2020-09-04 00:01:56 UTC
(In reply to Reid Wahl from comment #0)
> However, there are some special considerations where I'm not sure what
> **should** happen.
> ...
> A related question is whether...

We can also consider a conditional decision on when to set attributes explicitly and when to unset them, depending on something like a resource's location in the hierarchy (top-level or child) or whether the meta attribute is set explicitly at some point above the resource in the hierarchy.

Every approach that I consider seems to lead to some type of counter-intuitive behavior or unexpected divergence from the current behavior. This will require some thought to make sure we don't surprise anyone too much. I'd love to hear other people's ideas, if you have them.

Comment 2 Ken Gaillot 2020-09-04 16:04:07 UTC
It is tricky. Maybe additional warnings when settings conflict would help.

Another confounding factor is that settings can be controlled by rules. So rsc1 might be disabled between midnight and 5 a.m., or only IPaddr2 resources might default to disabled, etc.

One of my blue-sky to-do items is a new crm_rule option to evaluate the current value of any given attribute, considering all defaults, rules, etc. There's no BZ for that yet, but that might be the better approach, if we can also show where the value comes from. (Not that it would be easy.) pcs could keep its behavior mostly the same but always call that. I'm thinking something like:

   # crm_rule --evaluate --resource rsc1 --meta is-managed
   via default value: true

   # crm_rule --evaluate --resource rsc2 --meta is-managed
   via resource defaults: false

   # crm_rule --evaluate --resource rsc3 --meta is-managed
   via group meta-attribute: true

   # crm_rule --evaluate --resource group1 --meta target-role --output-as xml
   <pacemaker-result api-version="2.2" request="crm_rule --evaluate --resource group1 --meta target-role --output-as xml">
      <meta-attribute resource="group1" name="target-role" value="Stopped" source="resource defaults">
      <status code="0" message="OK"/>
   </pacemaker-result>

   # pcs resource enable group1
   group1 is now disabled (by resource defaults)

   # pcs resource enable group1 --force
   group1 is now enabled (by group meta-attribute)

The only pcs behavioral change would be using --force with enable/manage to set an explicit value.

Comment 3 Tomas Jelinek 2020-09-07 12:42:02 UTC
As Ken described, just figuring out why a resource is disabled / unmanaged is not trivial. Pacemaker also allows (and pcs will allow it as well, once bz1250744 is resolved) to set target-role and is-managed with rules. If meta attributes with rules are used, where should 'pcs resource enable' put the target-role=Started? Modifying the meta attributes with rules doesn't seem right as they are not in effect all the time. If pcs puts the target-role=Started to meta attributes with no rules, would that override meta-attributes with a rule? And if such override is permanent, we will need a way to revert to default. For this I like Ken's idea of 'pcs resource enable' just removing the target-role attribute reverting it to default and letting other parts of CIB to control it, while 'pcs resource enable --force' would set the target-role attribute to Started.

Comment 7 RHEL Program Management 2022-03-03 07:27:22 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.