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 1281463 - cluster properties metadata do not specify allowed values for enum properties
Summary: cluster properties metadata do not specify allowed values for enum properties
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.5
Hardware: All
OS: All
low
low
Target Milestone: pre-dev-freeze
: 8.6
Assignee: gchin
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-12 15:05 UTC by Tomas Jelinek
Modified: 2022-06-07 17:29 UTC (History)
6 users (show)

Fixed In Version: pacemaker-2.1.2-1.el8
Doc Type: No Doc Update
Doc Text:
This is mostly invisible to users
Clone Of:
Environment:
Last Closed: 2022-05-10 14:09:46 UTC
Type: Enhancement
Target Upstream Version: 2.1.2
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1384484 0 low CLOSED Some resource agents' metadata do not conform to the xml schema 2021-10-07 14:31:45 UTC
Red Hat Issue Tracker CLUSTERQE-5162 0 None None None 2021-10-26 14:02:33 UTC
Red Hat Issue Tracker CLUSTERQE-5486 0 None None None 2022-03-14 17:01:08 UTC
Red Hat Issue Tracker RHELPLAN-96005 0 None None None 2021-09-02 14:20:13 UTC
Red Hat Product Errata RHBA-2022:1885 0 None None None 2022-05-10 14:10:01 UTC

Internal Links: 1384484

Description Tomas Jelinek 2015-11-12 15:05:51 UTC
Description of problem:
Pacemaker provides a list of cluster properties in xml format. This can be used to automatically generate a form for managing the properties. Allowed values of enum properties are listed in longdesc, which is suboptimal, as it requires the form-generating code to parse plain text in order to find them.


Version-Release number of selected component (if applicable):
pacemaker-1.1.13-10.el7.x86_64


How reproducible:
always, easily


Steps to Reproduce:
1. [root@rh71-node1:~]# /usr/libexec/pacemaker/pengine metadata


Actual results:
Allowed values are part of the longdesc text:
[root@rh71-node1:~]# /usr/libexec/pacemaker/pengine metadata | head -n 15
<?xml version="1.0"?><!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="Policy Engine">
  <version>1.0</version>
  <longdesc lang="en">This is a fake resource that details the options that can be configured for the Policy Engine.</longdesc>
  <shortdesc lang="en">Policy Engine Options</shortdesc>
  <parameters>
    <parameter name="no-quorum-policy" unique="0">
      <shortdesc lang="en">What to do when the cluster does not have quorum</shortdesc>
      <content type="enum" default="stop"/>
      <longdesc lang="en">What to do when the cluster does not have quorum  Allowed values: stop, freeze, ignore, suicide</longdesc>
    </parameter>
    <parameter name="symmetric-cluster" unique="0">
      <shortdesc lang="en">All resources can run anywhere by default</shortdesc>
      <content type="boolean" default="true"/>
      <longdesc lang="en">All resources can run anywhere by default</longdesc>


Expected results:
Allowed description are defined in xml for them to be easily parsed.
Example:
[root@rh71-node1:~]# fence_idrac -o metadata
{snip}
<parameters>
        <parameter name="auth" unique="0" required="0">
                <getopt mixed="-A, --auth=[auth]" />
                <content type="select"  >
                        <option value="md5" />
                        <option value="password" />
                        <option value="none" />
                </content>
                <shortdesc lang="en">IPMI Lan Auth type.</shortdesc>
        </parameter>
{snip}


Additional info:
Please check also:
/usr/libexec/pacemaker/cib metadata
/usr/libexec/pacemaker/crmd metadata

Comment 1 Andrew Beekhof 2015-11-25 23:09:56 UTC
OCF metadata blocks do not support such information.
They could be extended to do so, but that is a larger effort.

Comment 2 Ken Gaillot 2015-12-04 00:23:47 UTC
This is not really a pacemaker issue, since pacemaker wouldn't supply or use the new metadata in any way. To implement this, you'd have to coordinate with the OCF folks to update the standard, and then with the various resource agent and fence agent maintainers to implement the new metadata.

Bumping this bug back to you so you can decide what to do with it next.

After discussing the idea with Andrew Beekhof, we think the best approach would be a single new metadata field (per option) for a regular expression to validate the value. Then, once the user has filled out the form, run the agent's validate action to ensure the values are all valid together.

That may not be quite as friendly as a drop-down menu, but there are too many possible variations of legal values to implement this realistically. What if option A can have different legal values based on how option B is set? What if option C is required only if options D or E are set? You would quickly get to something like an RNG schema definition, and resource agent writers can't be presumed to do that.

Comment 3 Ken Gaillot 2015-12-04 00:28:03 UTC
Forgot to add -- if you do get the OCF community to agree on something, clone this bug for pacemaker, and we'll add the new field(s) to internally generated metadata.

Comment 4 Jan Pokorný [poki] 2015-12-07 17:32:04 UTC
Re [comment 2]:

> That may not be quite as friendly as a drop-down menu, but there are
> too many possible variations of legal values to implement this
> realistically.  What if option A can have different legal values based
> on how option B is set? What if option C is required only if options
> D or E are set?  You would quickly get to something like an RNG schema
> definition,

This is what I was proposing at the HA Summit this earlier year.
You can express many complex inter-dependencies with that, and
given that native RelaxNG is also parseable XML, CLI tools could
cope with that (or a standardized subset) quite well
(enumeration of values -> drop down in webUI, etc.).

Plain regexp is a subset of what RelaxNG can handle.

> and resource agent writers can't be presumed to do that.

Provided that implicit default is "any string", using RelaxNG like
static(!) expression of valid values (overapproximation of what
the agent can evaluate OK in run-time it the specific context via
validate action) is a dramatic improvement of user experience and
as it would be optional anyway, we can contribute such enrichments
to the agents we are interested in.

FAs based on fencing.py could generate it more automatically
provided that mutual exclusion and other inter-param relationships
are encoded in a suitable way.


Btw. either regexp or RelaxNG approach could finally mark fields
that cannot contain any whitespace (in radix) to avoid triggering
bugs connected with extremely difficult proper handling in shell
based agents:
http://oss.clusterlabs.org/pipermail/users/2015-May/000403.html

Comment 7 RHEL Program Management 2020-12-15 07:38:31 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.

Comment 8 Tomas Jelinek 2021-09-02 14:16:59 UTC
Reopening and moving to pacemaker to consider migrating pacemaker-generated metadata ('/usr/libexec/pacemaker/pacemaker-fenced metadata', '/usr/libexec/pacemaker/pacemaker-schedulerd metadata', '/usr/libexec/pacemaker/pacemaker-controld metadata', '/usr/libexec/pacemaker/pacemaker-based metadata') to OCF 1.1. The main idea is to move lists of allowed values from 'longdesc' to 'option' elements in 'content' element - see comment 0.

Comment 10 Ken Gaillot 2021-09-02 14:26:33 UTC
Thanks, I've been meaning to circle back around to this

Comment 11 Ken Gaillot 2021-10-07 20:09:04 UTC
For ease of tracking, I am moving this bz to RHEL 8.6 since the fix is expected in both 8.6 and 9.0GA. The fix will be tested for 9.0 as part of the 9.0 rebase bz.

Comment 12 Ken Gaillot 2021-10-19 14:30:49 UTC
Fixed upstream as of commit 4f9c7ef6

Comment 18 Markéta Smazová 2022-01-11 17:00:02 UTC
[root@virt-134 ~]# rpm -q pacemaker
pacemaker-2.1.2-2.el8.x86_64

[root@virt-134 ~]# /usr/libexec/pacemaker/pacemaker-schedulerd metadata | head -n 15
<?xml version="1.0"?><!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="pacemaker-schedulerd">
  <version>1.1</version>
  <longdesc lang="en">Cluster options used by Pacemaker's scheduler (formerly called pengine)</longdesc>
  <shortdesc lang="en">Pacemaker scheduler options</shortdesc>
  <parameters>
    <parameter name="no-quorum-policy">
      <shortdesc lang="en">What to do when the cluster does not have quorum</shortdesc>
      <longdesc lang="en">What to do when the cluster does not have quorum  Allowed values: stop, freeze, ignore, demote, suicide</longdesc>
      <content type="select" default="stop">
        <option value="stop" />
        <option value="freeze" />
        <option value="ignore" />
        <option value="demote" />
        <option value="suicide" />

verified as SanityOnly in pacemaker-2.1.2-2.el8

Comment 20 errata-xmlrpc 2022-05-10 14:09:46 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 (pacemaker bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2022:1885


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