Bug 1885302
| Summary: | reflect changes in crm_mon --as-xml | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Tomas Jelinek <tojeline> | ||||
| Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
| Severity: | high | Docs Contact: | Steven J. Levine <slevine> | ||||
| Priority: | high | ||||||
| Version: | 8.3 | CC: | cfeist, cluster-maint, idevat, lmiksik, mlisik, mmazoure, mpospisi, nhostako, omular, slevine, tojeline | ||||
| Target Milestone: | rc | Keywords: | Triaged | ||||
| Target Release: | 8.5 | Flags: | pm-rhel:
mirror+
|
||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | pcs-0.10.8-2.el8 | Doc Type: | No Doc Update | ||||
| Doc Text: |
This is an internal change which should not be visible to users.
|
Story Points: | --- | ||||
| Clone Of: | |||||||
| : | 1985981 (view as bug list) | Environment: | |||||
| Last Closed: | 2021-11-09 17:33:51 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: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1985981, 1999022 | ||||||
| Attachments: |
|
||||||
|
Description
Tomas Jelinek
2020-10-05 14:48:32 UTC
Error reporting has changed:
old version:
# crm_mon --as-xml
Not connected
crm_mon: Error: cluster is not available on this node
<crm_mon version="2.0.5"/>
# echo $?
102
new version:
# crm_mon --output-as=xml
<pacemaker-result api-version="2.3" request="crm_mon --output-as=xml">
<status code="102" message="Not connected">
<errors>
<error>crm_mon: Error: cluster is not available on this node</error>
</errors>
</status>
</pacemaker-result>
# echo $?
102
In the new version, an xml must be parsed to obtain an error message.
Created attachment 1782051 [details]
proposed fix + tests
Adapt pcs to the new crm_mon XML format. No change should be visible to the users except minor error message changes.
We still need to take a look at the 'pcs status xml' command to see and deal with any impact caused by switching to the new format. Test: [root@r8-node-01 ~]# rpm -q pcs pcs-0.10.8-2.el8.x86_64 This is an internal change and there should be no visible changes. Some commands with --wait option uses this output for checking cluster state. [root@r8-node-01 ~]# pcs cluster start --wait --debug | grep 'Running' | grep 'crm_mon' Running: /usr/sbin/crm_mon --help-all Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml BEFORE:
=======
[root@virt-514 ~]# rpm -q pcs
pcs-0.10.8-1.el8.x86_64
[root@virt-514 ~]# pcs cluster start --wait --debug | grep 'crm_mon'
Running: /usr/sbin/crm_mon --one-shot --as-xml --inactive
Finished running: /usr/sbin/crm_mon --one-shot --as-xml --inactive
<crm_mon version="2.0.5">
</crm_mon>
Running: /usr/sbin/crm_mon --one-shot --as-xml --inactive
Finished running: /usr/sbin/crm_mon --one-shot --as-xml --inactive
<crm_mon version="2.0.5">
</crm_mon>
{...}
> pcs using crm_mon --as-xml format
AFTER:
======
[root@virt-042 ~]# rpm -q pcs
pcs-0.10.8-2.el8.x86_64
## Checking, that the internal change is present and the command functionality preserved
[root@virt-042 ~]# pcs cluster start --wait --debug | grep 'Running' | grep 'crm_mon'
Running: /usr/sbin/crm_mon --help-all
Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
Running: /usr/sbin/crm_mon --help-all
Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
Running: /usr/sbin/crm_mon --help-all
{...}
[root@virt-042 ~]# echo $?
0
[root@virt-049 ~]# pcs resource enable res --wait --debug | grep "Running" | grep "crm_mon"
Running: /usr/sbin/crm_mon --help-all
Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
Running: /usr/sbin/crm_mon --help-all
Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
[root@virt-049 ~]# echo $?
0
> pcs using new format crm_mon --output-as xml and the functionality of the command preserved
> tested with various pcs commands that using --wait flag (cluster start, resource enable/disable/safe-disable/move/ban/group add, stonith enable/disable)
## Checking error output
[root@virt-042 ~]# pcs cluster destroy
Shutting down pacemaker/corosync services...
Killing any remaining services...
Removing all cluster configuration files...
[root@virt-042 ~]# pcs cluster start --wait --debug
Error: cluster is not currently configured on this node
[root@virt-042 ~]# echo $?
1
> OK
## on other node
[root@virt-049 ~]# pcs cluster stop
Stopping Cluster (pacemaker)...
Stopping Cluster (corosync)...
[root@virt-049 ~]# pcs cluster start --wait=1 --debug | grep 'crm_mon'
Running: /usr/sbin/crm_mon --help-all
Finished running: /usr/sbin/crm_mon --help-all
crm_mon [OPTION?]
If this program is called as crm_mon.cgi, --output-as=html --html-cgi will
When run interactively, crm_mon can be told to hide and display various sections
crm_mon
crm_mon -1
crm_mon --group-by-node --inactive
Start crm_mon as a background daemon and have it write the cluster status to an HTML file:
crm_mon --daemonize --output-as html --output-to /path/to/docroot/filename.html
Start crm_mon and export the current cluster status as XML to stdout, then exit:
crm_mon --output-as xml
Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
Finished running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
<pacemaker-result api-version="2.9" request="/usr/sbin/crm_mon --one-shot --inactive --output-as xml">
Error: Waiting timeout
> OK, the error messages preserved
Marking as VERIFIED SanityOnly for pcs-0.10.8-2.el8
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 (Low: pcs security, 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/RHSA-2021:4142 |