Bug 1667090

Summary: errors in knet link list validation
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: high    
Version: 8.0CC: cfeist, cluster-maint, idevat, mlisik, nhostako, omular, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.1-6.el8 Doc Type: Bug Fix
Doc Text:
Cause: User enters options for more links than how many is defined by nodes' addresses or uses a linknumber which does not match any defined link in pcs cluster setup command. Consequence: Pcs sets up a cluster anyway or reports misleading errors. Fix: Links related validation in pcs including resulting error messages has been fixed. Result: Pcs validates links and linknumbers correctly and reports correctly worded errors.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:39: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:
Embargoed:
Bug Depends On: 1682129    
Bug Blocks: 1667058    
Attachments:
Description Flags
proposed fix + tests none

Description Tomas Jelinek 2019-01-17 12:25:43 UTC
Description of problem:
Several issues have been found in knet link list validation.


Version-Release number of selected component (if applicable):
pcs-0.10.1-2.el8


How reproducible:
always, easily


Steps to Reproduce:
A) pcs cluster setup test rh80-node3 addr=192.168.122.203 transport knet link linknumber=0 link linknumber=1
B) pcs cluster setup test rh80-node3 addr=192.168.122.203 transport knet link linknumber=0 link linknumber=1 link linknumber=2


Actual results:
A) A new cluster is successfully created.
B)
Error: '2' is not a valid linknumber value, use 0..1
Error: Cannot set 3 links, knet transport supports up to 2 links
Error: Errors have occurred, therefore pcs is unable to continue


Expected results:
A) A cluster should have not been created as number of specified links exceeds number of specified addresses of each node.
B)
> Error: '2' is not a valid linknumber value, use 0..1
Not true, linknumber can be 0..7
> Error: Cannot set 3 links, knet transport supports up to 2 links
Not true, knet transport supports up to 8 links.
An error message saying number of specified links exceeds number of specified addresses of each node is missing.

Comment 2 Tomas Jelinek 2019-02-27 12:51:40 UTC
Another issue:

pcs cluster setup test rh80-node3 addr=192.168.122.203 addr=192.168.123.203 transport knet link linknumber=0 link linknumber=6

This should exit with an error saying it is not possible to configure link 6 when there are only two links specified.

Comment 3 Tomas Jelinek 2019-03-01 09:54:35 UTC
Created attachment 1539780 [details]
proposed fix + tests

After fix:

[root@rh80-node1:~]# pcs cluster setup test rh80-node3 addr=192.168.122.203 addr=192.168.123.203 transport knet link linknumber=0 link linknumber=6 link linknumber=8
Error: Cannot set options for non-existent link '6', 2 links are defined starting with link 0
Error: '8' is not a valid linknumber value, use 0..7
Error: Cannot specify options for more links (3) than how many is defined by number of addresses per node (2)
Error: Errors have occurred, therefore pcs is unable to continue
[root@rh80-node1:]# echo $?
1

Comment 4 Ondrej Mular 2019-05-02 12:05:47 UTC
After fix:
[root@rhel81-node1 ~]# rpm -q pcs
pcs-0.10.1-6.el8.x86_64

[root@rhel81-node1 ~]# pcs cluster setup test rh81-1 addr=192.168.122.203 addr=192.168.123.203 transport knet link linknumber=0 link linknumber=6 link linknumber=8
Error: Cannot set options for non-existent link '6', 2 links are defined starting with link 0
Error: '8' is not a valid linknumber value, use 0..7
Error: Cannot specify options for more links (3) than how many is defined by number of addresses per node (2)
Error: Errors have occurred, therefore pcs is unable to continue
[root@rhel81-node1 ~]# echo $?
1

Comment 8 errata-xmlrpc 2019-11-05 20:39:40 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, 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/RHEA-2019:3311