| Summary: | pcs operates incorrectly with "depth" attribute of resource operation | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ivan Devat <idevat> | ||||
| Component: | pcs | Assignee: | Ivan Devat <idevat> | ||||
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 7.2 | CC: | cfeist, cluster-maint, idevat, oalbrigt, omular, rsteiger, tojeline | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | pcs-0.9.156-1.el7 | Doc Type: | Bug Fix | ||||
| Doc Text: |
Cause:
The user runs "pcs resource create" with a resource agent, that contains an action with attribute depth != 0.
Consequence:
Pcs produces invalid cib and ends with an error message.
Fix:
Pcs transforms attribute "depth" into instance attribute "OCF_CHECK_LEVEL".
Result:
Pcs creates correctly the resource with a resource agent that contains an action with attribute depth != 0.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2017-08-01 18:24:40 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: | |||||
| Attachments: |
|
||||||
|
Description
Ivan Devat
2016-10-27 15:28:07 UTC
If we allow the "depth" attribute to be used, we need to handle a situation where both "depth" and "OCF_CHECK_LEVEL" is specified. Created attachment 1246568 [details] proposed fix Test: > attribute "depth" in the resource agent is transformed into "OCF_CHECK_LEVEL" 1) Put the attribute "depth" != 0 into a resource agent Edit /usr/lib/ocf/resource.d/heartbeat/Dummy: Put line <action name="monitor" timeout="20" interval="15" depth="10" /> after line <action name="monitor" timeout="20" interval="10" depth="0" /> in metadata section. 2) Try to create a resource with this agent [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy Warning: changing a monitor operation interval from 10 to 11 to make the operation unique [vm-rhel72-1 ~] $ pcs cluster cib scope=resources | grep 'id="R"' -A11 <primitive class="ocf" id="R" provider="heartbeat" type="Dummy"> <operations> <op id="R-monitor-interval-10" interval="10" name="monitor" timeout="20"/> <op id="R-monitor-interval-11" interval="11" name="monitor" timeout="20"> <instance_attributes id="R-monitor-interval-11-instance_attributes"> <nvpair id="R-monitor-interval-11-instance_attributes-OCF_CHECK_LEVEL" name="OCF_CHECK_LEVEL" value="10"/> </instance_attributes> </op> <op id="R-start-interval-0s" interval="0s" name="start" timeout="20"/> <op id="R-stop-interval-0s" interval="0s" name="stop" timeout="20"/> </operations> </primitive> > limited support of attribute "depth" Attribute depth is not supported on the command line. For the backward compatibility we keep support for "OCF_CHECK_LEVEL" on the command line. The attribute "depth" could be confusing beside "OCF_CHECK_LEVEL". After Fix:
[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.156-1.el7.x86_64
[vm-rhel72-1 ~] $ cp /usr/lib/ocf/resource.d/heartbeat/Dummy /usr/lib/ocf/resource.d/heartbeat/Dummy.backup
[vm-rhel72-1 ~] $ sed -i 's/\(<action name="monitor".*\)$/\1\n<action name="monitor" timeout="20" interval="15" depth="10"\/>/' /usr/lib/ocf/resource.d/heartbeat/Dummy
[vm-rhel72-1 ~] $ cat /usr/lib/ocf/resource.d/heartbeat/Dummy | grep '<action name="monitor"'
<action name="monitor" timeout="20" interval="10" depth="0" />
<action name="monitor" timeout="20" interval="15" depth="10"/>
[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy
[vm-rhel72-1 ~] $ pcs cluster cib|grep 'id="R-monitor-interval-15"' -A4
<op id="R-monitor-interval-15" interval="15" name="monitor" timeout="20">
<instance_attributes id="R-monitor-interval-15-instance_attributes">
<nvpair id="R-monitor-interval-15-instance_attributes-OCF_CHECK_LEVEL" name="OCF_CHECK_LEVEL" value="10"/>
</instance_attributes>
</op>
[vm-rhel72-1 ~] $ mv /usr/lib/ocf/resource.d/heartbeat/Dummy.backup /usr/lib/ocf/resource.d/heartbeat/Dummy
*** Bug 1473356 has been marked as a duplicate of this bug. *** 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, 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-2017:1958 |