Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replicas_on_same replicas_on_different stopped working #31

Open
kvaps opened this issue Aug 19, 2019 · 6 comments
Open

replicas_on_same replicas_on_different stopped working #31

kvaps opened this issue Aug 19, 2019 · 6 comments

Comments

@kvaps
Copy link
Member

kvaps commented Aug 19, 2019

Hi, my storageClass:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: linstor-a-b
parameters:
  ReplicasOnDifferent: side
  ReplicasOnSame: moonshot
  autoPlace: "2"
  storagePool: thindata
provisioner: linstor.csi.linbit.com

Provisioner runs:

curl -X 'POST' -d '{"select_filter":{"place_count":2,"storage_pool":"thindata","replicas_on_same":["moonshot"],"replicas_on_different":["side"]},"layer_list":["DRBD","STORAGE"]}' -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://localhost:3370/v1/resource-definitions/pvc-01a17976-a143-4c31-b118-3bcccb7951e5/autoplace'

but correct commad is:

curl -X 'POST' -d '{"select_filter":{"place_count":2,"storage_pool":"thindata","replicas_on_same":["Aux/moonshot"],"replicas_on_different":["Aux/side"]},"layer_list":["DRBD","STORAGE"]}' -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://localhost:3370/v1/resource-definitions/pvc-01a17976-a143-4c31-b118-3bcccb7951e5/autoplace'

version:

image: quay.io/linbit/linstor-csi:v0.7.2
@deleteriousEffect
Copy link
Contributor

@rp- replicas_on_same and replicas_on_different both target only Auxprops, right? Should they need to be manually namespaced like this?

@rp-
Copy link

rp- commented Aug 20, 2019

correct they only target Aux/ properties and as far as I know from my head the Aux/ should not be included.

@kvaps
Copy link
Member Author

kvaps commented Aug 20, 2019

as far as I know from my head the Aux/ should not be included.

@rp-, you're wrong, just look at this:

# curl -X 'POST' -d '{"select_filter":{"place_count":2,"storage_pool":"thindata","replicas_on_same":["moonshot"],"replicas_on_different":["side"]},"layer_list":["DRBD","STORAGE"]}' -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://localhost:3370/v1/resource-definitions/test-foo/autoplace'
[
  {
    "ret_code": -4611686018407202000,
    "message": "Not enough available nodes",
    "details": "Not enough nodes fulfilling the following auto-place criteria:\n * has a deployed storage pool named 'thindata'\n * the storage pool 'thindata' has to have at least '1048576' free space\n * the current access context has enough privileges to use the node and the storage pool\n * the node is online\nAuto-placing resource: test-foo",
    "error_report_ids": [
      "5D56B906-00000-000193"
    ],
    "obj_refs": {
      "RscDfn": "test-foo"
    }
  }
]
# linstor --curl r c test-foo --replicas-on-same moonshot --replicas-on-different side --auto-place=2 -s thindata
curl -X POST -H "Content-Type: application/json" -d '{"select_filter": {"place_count": 2, "storage_pool": "thindata", "replicas_on_same": ["Aux/moonshot"], "replicas_on_different": ["Aux/side"]}, "diskless_on_remaining": null}' http://localhost:3370/v1/resource-definitions/test-foo/autoplace
# curl -X 'POST' -d '{"select_filter":{"place_count":2,"storage_pool":"thindata","replicas_on_same":["Aux/moonshot"],"replicas_on_different":["Aux/side"]},"layer_list":["DRBD","STORAGE"]}' -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://localhost:3370/v1/resource-definitions/test-foo/autoplace'
[
  {
    "ret_code": 20185089,
    "message": "Resource 'test-foo' successfully autoplaced on 2 nodes",
    "details": "Used storage pool: 'thindata'\nUsed nodes: 'm1c4', 'm1c7'",
    "obj_refs": {
      "RscDfn": "test-foo"
    }
  },
  {
    "ret_code": 20185091,
    "message": "Created resource 'test-foo' on 'm1c7'",
    "obj_refs": {
      "RscDfn": "test-foo"
    }
  },
  {
    "ret_code": 20185091,
    "message": "Created resource 'test-foo' on 'm1c4'",
    "obj_refs": {
      "RscDfn": "test-foo"
    }
  },
  {
    "ret_code": 20185089,
    "message": "Resource 'test-foo' on 'm1c7' ready",
    "details": "Auto-placing resource: test-foo",
    "obj_refs": {
      "RscDfn": "test-foo"
    }
  },
  {
    "ret_code": 20185089,
    "message": "Resource 'test-foo' on 'm1c4' ready",
    "details": "Auto-placing resource: test-foo",
    "obj_refs": {
      "RscDfn": "test-foo"
    }
  }
]

@rp-
Copy link

rp- commented Aug 20, 2019

you are right, I mixed that up, on the command line client the Aux/ namespace gets added automatically. but if you use REST directly it has to be specified

@deleteriousEffect
Copy link
Contributor

This must have happened on the switch over to the REST api. I'll fix it so that you don't need to specify them in the StorageClass.

@kvaps
Copy link
Member Author

kvaps commented Aug 20, 2019

you don't need to specify them in the StorageClass.

no problem, this is just good workaround to make it working until upgrade :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants