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 1376538 - fencing: No allowance for spaces in pcmk_host_map values
Summary: fencing: No allowance for spaces in pcmk_host_map values
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.0
Hardware: All
OS: Linux
medium
low
Target Milestone: pre-dev-freeze
: 8.6
Assignee: Ken Gaillot
QA Contact: cluster-qe@redhat.com
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-15 16:22 UTC by John Ruemker
Modified: 2022-06-07 17:30 UTC (History)
7 users (show)

Fixed In Version: pacemaker-2.1.2-1.el8
Doc Type: Enhancement
Doc Text:
.Support for special characters inside `pcmk_host_map` values The `pcmk_host_map` property now supports special characters inside `pcmk_host_map` values using a backslash (\) in front of the value. For example, you can specify `pcmk_host_map="node3:plug\ 1"` to include a space in the host alias.
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
Cluster Labs 5444 0 None None None 2020-10-02 21:55:15 UTC
Red Hat Issue Tracker CLUSTERQE-5164 0 None None None 2021-10-26 14:02:22 UTC
Red Hat Issue Tracker CLUSTERQE-5488 0 None None None 2022-03-15 05:01:29 UTC
Red Hat Knowledge Base (Solution) 2619961 0 None None None 2022-05-13 15:18:05 UTC
Red Hat Knowledge Base (Solution) 5277821 0 None None None 2022-05-13 15:14:33 UTC
Red Hat Product Errata RHBA-2022:1885 0 None None None 2022-05-10 14:10:01 UTC

Description John Ruemker 2016-09-15 16:22:18 UTC
Description of problem: pacemaker treats spaces in pcmk_host_map as delimiters between map entries, which prevents one from being able to specify an alias that contains a space in it.  I discovered this in our lab environment where the admin had named the ports (or possible the APC firmware does this automatically) as "cs-rh7-1 [1/2]", "cs-rh7-1 [2/2]", etc to signify the various ports for that system.  My intention was to create a map that would be able to detect each of these ports, but without using spaces that is impossible.  For example:

  pcmk_host_list="cs-rh7-1-clust.examplerh.com:cs-rh7-1 [1/2],cs-rh7-1 [2/2];cs-rh7-2-clust.examplerh.com:cs-rh7-2 [1/2],cs-rh7-2 [2/2]"

I see no way in the code that processes this list where it would be possible to escape this character or otherwise trick it into accepting it. 

While I can get the port names changed, in many customer organizations we find its difficult to carry such changes out, since often different internal teams manage the infrastructure and administration of the systems in question.  The infrastructure team may have standard naming conventions, or just may not be immediately available to correct problems like these.  So, while I haven't had any customers hit this yet, it'd be nice to find a way to allow spaces. 

I expect one could probably work-around this by having multiple devices each with their own single-node pcmk_host_list and manually specifying the port value, but that's tedious and defeats the purpose of the pcmk_host_map.


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


How reproducible: Easily


Steps to Reproduce:
1. Find/configure a stonith device that is capable of performing a list operation, and allows you to configure the labels that get listed.  Name one of the ports with something that includes a space.

2. Attempt to configure a shared stonith device using pcmk_host_map.


Actual results: The stonith device does not successfully the nodes it should manage.


Expected results: stonith device can successfully fence the nodes it should manage.


Additional info:

Comment 1 John Ruemker 2016-09-15 16:25:07 UTC
I don't have a great idea for how we could fix this without disrupting existing configurations.  In my experience, most users prefer to use space as a delimiter over semi-colon, so if we start interpreting spaces differently, we're sure to cause problems.

After that my best idea is to use a hack-job of a special character that signifies space in the alias.  [[space]] or something like that.  Not pretty, and definitely not intuitive (you'd have to just know about the alias for this character, and who reads manpages anymore?), but it'd be better than having no option at all.

Comment 2 Andrew Beekhof 2016-09-15 22:30:19 UTC
For the record, I'm not super keen on allowing characters out of the range of a-zA-Z0-0._- (basically the same as host names).

If we add [[space]] we'd probably need [[colon]] and [[comma]] too :-(

I'd prefer to document the restriction instead.

Comment 3 Ken Gaillot 2016-10-06 20:28:49 UTC
Since pacemaker at the lowest level uses XML, I thought this might be possible using   in place of the space. However, pacemaker substitutes a space for that when reading and writing the CIB, so it is quickly lost, and is not treated any differently.

I think the simplest approach would be to allow a backslash to mean that the next character is part of the text, and should have no special meaning to pacemaker. '\ ', '\:', and'\,' would handle the cases mentioned in Comment 2. I'll see what I can do with that.

BTW, I could understand some users might want to use e.g. accented characters, too. I thought maybe using ñ or its equivalent Ñ would work as expected, since pacemaker doesn't use it as a separator, but it does not. But that's a different (and more complicated) question -- even if we had such a representation for characters, we'd still need a way to tell pacemaker to pass the character to the fence device rather than interpret it itself.

Comment 4 Ken Gaillot 2017-03-06 23:27:12 UTC
This will not be ready in the 7.4 timeframe.

Comment 5 Ken Gaillot 2017-10-09 17:23:57 UTC
Due to time constraints, this will not make 7.5

Comment 6 Ken Gaillot 2019-01-15 18:00:02 UTC
Bumping to RHEL 8.1 due to devel/QA capacity constraints

Comment 9 Ken Gaillot 2020-10-02 21:55:16 UTC
Due to developer time constraints, this issue has been reported upstream, and this report will be closed. If developer time becomes available for it, this report will be reopened.

Comment 10 Ken Gaillot 2021-08-17 19:42:17 UTC
Fixed upstream as of commit e95198f3

Comment 18 Markéta Smazová 2022-01-11 16:17:13 UTC
Verified as SanityOnly in pacemaker-2.1.2-2.el8

Comment 22 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.