Hide Forgot
Description of problem: "resource create" with flags --clone and --disable puts metadata for disabling inappropriately. It puts it as primitive meta_attributes. How reproducible: always Steps to Reproduce: [vm-rhel72-1 ~] $ pcs resource create R1 ocf:heartbeat:Dummy --clone --disabled --no-default-ops Actual results: In cib, there is: ... <clone id="R1-clone"> <primitive class="ocf" id="R1" provider="heartbeat" type="Dummy"> <instance_attributes id="R1-instance_attributes"/> <meta_attributes id="R1-meta_attributes"> <nvpair id="R1-meta_attributes-target-role" name="target-role" value="Stopped"/> </meta_attributes> <operations> <op id="R1-monitor-interval-60s" interval="60s" name="monitor"/> </operations> </primitive> <meta_attributes id="R1-clone-meta_attributes"/> </clone> ... Expected results: in cib: ... <clone id="R1-clone"> <primitive class="ocf" id="R1" provider="heartbeat" type="Dummy"> <instance_attributes id="R1-instance_attributes"/> <operations> <op id="R1-monitor-interval-60s" interval="60s" name="monitor"/> </operations> </primitive> <meta_attributes id="R1-clone-meta_attributes"> <nvpair id="R1-clone-meta_attributes-target-role" name="target-role" value="Stopped"/> </meta_attributes> </clone> ... Additional info: Metadata are placed appropriately when is used --master instead of --clone: [vm-rhel72-1 ~] $ pcs resource create R2 ocf:heartbeat:Dummy --master --disabled --no-default-ops in cib: ... <master id="R2-master"> <primitive class="ocf" id="R2" provider="heartbeat" type="Dummy"> <instance_attributes id="R2-instance_attributes"/> <operations> <op id="R2-monitor-interval-60s" interval="60s" name="monitor"/> </operations> </primitive> <meta_attributes id="R2-master-meta_attributes"> <nvpair id="R2-master-meta_attributes-target-role" name="target-role" value="Stopped"/> </meta_attributes> </master> ... Metadata are placed appropriately when clone is created as enabled and then disabled: [vm-rhel72-1 ~] $ pcs resource create R3 ocf:heartbeat:Dummy --clone --no-default-ops [vm-rhel72-1 ~] $ pcs resource disable R3 in cib: ... <clone id="R3-clone"> <primitive class="ocf" id="R3" provider="heartbeat" type="Dummy"> <instance_attributes id="R3-instance_attributes"/> <operations> <op id="R3-monitor-interval-60s" interval="60s" name="monitor"/> </operations> </primitive> <meta_attributes id="R3-clone-meta_attributes"> <nvpair id="R3-clone-meta_attributes-target-role" name="target-role" value="Stopped"/> </meta_attributes> </clone> ...
Created attachment 1246362 [details] proposed fix Tests are in the patch.
After Fix: [vm-rhel72-1 ~] $ rpm -q pcs pcs-0.9.156-1.el7.x86_64 [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy --clone --disabled [vm-rhel72-1 ~] $ pcs cluster cib|grep 'id="R-clone"' -A11 <clone id="R-clone"> <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-start-interval-0s" interval="0s" name="start" timeout="20"/> <op id="R-stop-interval-0s" interval="0s" name="stop" timeout="20"/> </operations> </primitive> <meta_attributes id="R-clone-meta_attributes"> <nvpair id="R-clone-meta_attributes-target-role" name="target-role" value="Stopped"/> </meta_attributes> </clone>
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