Hide Forgot
Description of problem: An invalid cib report is produced when a user tries to create a colocation constraint with an invalid role (valid roles are started, master, slave) Version-Release number of selected component (if applicable): pcs-0.9.149-2.el7.x86_64 How reproducible: always Steps to Reproduce: 1. Create two resources [vm-rhel72-1 /] $ pcs resource create r1 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create r2 ocf:pacemaker:Dummy 2. Try create colocation for created resources with invalid role specification [vm-rhel72-1 /] $ pcs constraint colocation add invalid-role r1 with r2 Actual results: Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib ... Expected results: Error: Invalid value 'invalid-role' for role, allowed values are started, master, slave
There are more problems in this command: Steps to Reproduce: 1. Create resources with ids "r1", "r2" and "master" [vm-rhel72-1 /] $ pcs resource create r1 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create r2 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create master ocf:pacemaker:Dummy 2. Try create colocation for resources r1 and r2 with role specification, but forget keyword "with" [vm-rhel72-1 /] $ pcs constraint colocation add master r1 slave r2 Actual results: Colocation for resources master and r2 created. Expected results: No colocation created and usage for constraint colocation add listed.
Steps to Reproduce: 1. Create resources with ids "r1" and "r2" [vm-rhel72-1 /] $ pcs resource create r1 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create r2 ocf:pacemaker:Dummy 2. Try create colocation for resources r1 and r2 but forget keyword r2 [vm-rhel72-1 /] $ pcs add master r1 with Actual results: Traceback (most recent call last): File "/usr/sbin/pcs", line 219, in <module> main(sys.argv[1:]) File "/usr/sbin/pcs", line 159, in main cmd_map[command](argv) File "/usr/lib/python2.7/site-packages/pcs/constraint.py", line 67, in constraint_cmd colocation_add(argv) File "/usr/lib/python2.7/site-packages/pcs/constraint.py", line 194, in colocation_add if utils.is_score_or_opt(argv[1]): IndexError: list index out of range Expected results: Usage for constraint colocation add listed.
Steps to Reproduce: 1. Create resources with ids "r1" and "r2" [vm-rhel72-1 /] $ pcs resource create r1 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create r2 ocf:pacemaker:Dummy 2. Try create colocation for resources r1 and r2 but forget keyword r2 [vm-rhel72-1 /] $ pcs add r1 with Actual results: Error: Resource 'with' does not exist Expected results: Usage for constraint colocation add listed.
Steps to Reproduce: 1. Create resources with ids "r1", "r2" and "with" [vm-rhel72-1 /] $ pcs resource create r1 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create r2 ocf:pacemaker:Dummy [vm-rhel72-1 /] $ pcs resource create with ocf:pacemaker:Dummy 2. Try create colocation for resources r1 and r2 but forget keyword r2 [vm-rhel72-1 /] $ pcs add r1 with Actual results: Colocation for resources r1 and with created. Expected results: Usage for constraint colocation add listed.
This has been partially fixed in pcs-0.10 branch by removing support for deprecated syntax in https://github.com/ClusterLabs/pcs/commit/dcab313b1ed8948642a3efcd29c1bb0c33745a88
The issues described in comment 0 and comment 2 have been fixed in: https://github.com/ClusterLabs/pcs/commit/2c259f6604cbcef07bab4e76d4ff0f2a345c5c8a for pcs-0.9 branch https://github.com/ClusterLabs/pcs/commit/4afc322c39ccb0953de35951913721edddd44cfc for pcs-0.10 branch Comment 3 issue has not been fixed yet in pcs-0.9 branch. It has been already fixed in pcs-0.10 branch. Comment 4 and comment 5 cannot be really fixed due to the command supporting two syntaxes in pcs-0.9 branch. They have been fixed in pcs-0.10 branch.
This has been already fixed in RHEL 8, see comment 8. Considering the current RHEL 7 life cycle stage, there will be no further fixes for this bz in RHEL 7.