Created attachment 712558 [details] engine logs Description of problem: --------------------------------------- The following add-brick operation failed from the rhevm-shell - [RHEVM shell (connected)]# add brick --cluster-identifier gluster --glustervolume-identifier vol1 --brick-brick "brick.server_id=e54b7b16-92d2-4439-9312-74f1d435bd2f,brick.brick_dir=/tmp/brick5" error: status: 400 reason: Bad Request detail: volume add brick failed error: found duplicate exports 10.70.35.156:/tmp/brick5 usage: volume add-brick <volname> [<stripe|replica> <count>] <new-brick> ... return code: 255 Adding the same brick to the volume succeeded from the Console. Version-Release number of selected component (if applicable): rhevm-cli-3.2.0.5-1.el6ev.noarch How reproducible: Always Steps to Reproduce: 1. Try to add a brick to a gluster volume from rhevm-shell as described in the command above. Actual results: Add brick fails but the same action succeeds from the Console. Expected results: Action should succeed from rhevm-shell. Additional info: Attached engine logs.
AFAICS this is not related to the cli, but to your core gluster impl.
Michael, When add brick command is invoked with parameter --brick-brick "brick.server_id=e54b7b16-92d2-4439-9312-4f1d435bd2f,brick.brick_dir=/tmp/brick5" the BackendGlusterBricksResource.add method receives a collection of GlusterBricks with size 2 instead of 1. The GlusterBrick entities have duplicate values for server_id and brick_dir. Any idea why?
(In reply to comment #3) > Michael, > > When add brick command is invoked with parameter --brick-brick > "brick.server_id=e54b7b16-92d2-4439-9312-4f1d435bd2f,brick.brick_dir=/tmp/ > brick5" > > the BackendGlusterBricksResource.add method receives a collection of > GlusterBricks with size 2 instead of 1. The GlusterBrick entities have > duplicate values for server_id and brick_dir. > > Any idea why? it may be related to the bug 921464 (producing collections), please recheck against rhevm-cli 3.2.0.6
(In reply to comment #4) > (In reply to comment #3) > > Michael, > > > > When add brick command is invoked with parameter --brick-brick > > "brick.server_id=e54b7b16-92d2-4439-9312-4f1d435bd2f,brick.brick_dir=/tmp/ > > brick5" > > > > the BackendGlusterBricksResource.add method receives a collection of > > GlusterBricks with size 2 instead of 1. The GlusterBrick entities have > > duplicate values for server_id and brick_dir. > > > > Any idea why? > > it may be related to the bug 921464 (producing collections), please recheck > against rhevm-cli 3.2.0.6 Nope, I have the patches referred to in the bug and still face the issue. (I'm checking with ovirt master upstream) In debug mode: add brick --cluster-identifier "GlustCluster" --glustervolume-identifier "testv" --bricks-brick "brick.server_id=fcf6dcf4-51de-458d-b071-7634dbc5803c,brick.brick_dir=/tmp/br3" translates to: POST /api/clusters/6751c6a3-a1bd-4e26-a46f-7f16afe9e66e/glustervolumes/cc8c6355-f60f-4796-86ab-6f426f50bcda/bricks HTTP/1.1\r\nHost: localhost:8700\r\nAccept-Encoding: identity\r\nContent-Length: 285\r\nPrefer: persistent-auth\r\nAccept: application/xml\r\nFilter: False\r\ncookie: JSESSIONID=P2LYKcWKgF7HeuZ5M7r1-+2q.undefined\r\nContent-type: application/xml\r\n\r\n <bricks>\n <brick>\n <server_id>fcf6dcf4-51de-458d-b071-7634dbc5803c</server_id>\n <brick_dir>/tmp/br3</brick_dir>\n </brick>\n <brick>\n <server_id>fcf6dcf4-51de-458d-b071-7634dbc5803c</server_id>\n <brick_dir>/tmp/br3</brick_dir>\n </brick>\n</bricks>\n' Duplicate bricks are being passed to REST API from CLI
after rebasing after bug 921464 fix, running 'add' causes: error: "bricks" is invalid argument segment. (ravi, this is sounds like a regression)
the cause for the mentioned bug is inconsistent implementation of POST operation for .../bricks => add(*bricks*) and incorrect descriptor in RSDL (which was implemented as a standard add(*brick*) descriptor), according to the current implementation, RSDL descriptor for this op. should look like [1], another issue i see is lack of standard add(brick) signature what is breaks RESTful nature of api, [1] because add(*bricks*) already has external *bricks* container defined, brick arguments should be described without specifying FQ path (prefix) to the brick element (as it would be if it was nested type collection item) - mandatoryArguments: brick--COLLECTION: {brick.server_id: 'xs:string', brick.brick_dir: 'xs:string'} optionalArguments: brick--COLLECTION: {brick.replica_count: 'xs:unsignedShort', brick.stripe_count: 'xs:unsignedShort'}
not sure why this bug was moved to QA, it's still lacking part of the fix: http://gerrit.ovirt.org/#/c/13756/
Assigning to Ravi Nori as there's a fix in CLI required.
Add brick syntax example: add brick --cluster-identifier "GlusterC" --glustervolume-identifier "Repl" --brick "brick.server_id=c46e99c3-f83a-4031-9f18-f8ef459aae92,brick.brick_dir=/tmp/rpl11" --brick "brick.server_id=c46e99c3-f83a-4031-9f18-f8ef459aae92,brick.brick_dir=/tmp/rpl12" --replica_count 2
Verified with rhevm-cli-3.2.0.9-1.el6ev.noarch
3.2 has been released