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

Unsupported Scaleio 1.3 Logins ... EMC ScaleIO Version: R1_30.426.0 #19

Open
wallnerryan opened this issue Jun 2, 2015 · 7 comments
Open

Comments

@wallnerryan
Copy link
Contributor

have you succesfully used thi with 1.30? I i'm not sure there is a /api/login with 1.30, i am getting errors like below.

>>> from scaleiopy import scaleio
>>> sio = scaleio.ScaleIO("https://10.13.217.59/api","admin","Scaleio123",False, "ERROR")
>>> sio._login()
2015-06-02 10:41:59,481: ERROR scaleio:_login | Login error code: Not Found

I can however just use basic auth against the URL

curl -k --basic --user admin:Scaleio123 https://10.13.217.59:443/api/instances/Volume::4866dc8500000006
{"volumeType":"ThickProvisioned","mappingToAllSdcsEnabled":false,"mappedSdcInfo":[{"limitIops":0,"limitBwInMbps":0,"sdcId":"f530cf3700000000","sdcIp":"10.13.217.60"}],"sizeInKb":58720256,"mappedScsiInitiatorInfo":null,"isObfuscated":false,"consistencyGroupId":"0000000000000000","storagePoolId":"64d62fb200000002","ancestorVolumeId":"0000000000000000","vtreeId":"943b92b300000006","creationTime":1428436720,"name":"vol07","id":"4866dc8500000006","links":[{"rel":"self","href":"/api/instances/Volume::4866dc8500000006"},{"rel":"/api/Volume/relationship/Statistics","href":"/api/instances/Volume::4866dc8500000006/relationships/Statistics"},{"rel":"/api/parent/relationship/ancestorVolumeId","href":"/api/instances/Volume::0000000000000000"},{"rel":"/api/parent/relationship/vtreeId","href":"/api/instances/VTree::943b92b300000006"},{"rel":"/api/parent/relationship/storagePoolId","href":"/api/instances/StoragePool::64d62fb200000002"}]}

but not /login or api/login

(venv)[root@sclr059]# curl -k --basic --user admin:Scaleio123 https://10.13.217.59:443/api/login
{
  "message" : "Not Found",
  "httpStatusCode" : 404,
  "errorCode" : 0
}(venv)[root@sclr059]# curl -k --basic --user admin:Scaleio123 https://10.13.217.59:443/login
{
  "message" : "Not Found",
  "httpStatusCode" : 404,
  "errorCode" : 0
} 

Maybe we can bake in support?

@swevm
Copy link
Owner

swevm commented Jun 2, 2015

If I remember correct, login method and the use of a session key for authentication was a new feature to ease API integration starting with 1.31.

Haven't looked into what it takes to get it working with 1.30. Guess the get and post methods could be get its own version specific for 1.30. That obviously need a way to identify version of API when accessing it which do not exist to my knowledge. It's possible to get SIO version after login but not before.

@wallnerryan
Copy link
Contributor Author

Yeah, I think all 1.30 needs is the basic auth, no token or login.

Here's one way I was thinking. We could add a version flag to the scaleio.ScaleIO to easily identify intent to use a version, we could default to 1.31or allow an identifying function to process strings of "1.31, 131, 1.3.1" to or somthing and set the classifier of somthing like 1_30="1.30"

The tougher part is deciding what to do with the flow of initialization. E.g. ScaleIO calls _check_login() and _login() a lot, and we would need to not "actually" login if the 1.30 flag is set or something. One thought is we would still need to check if the user/pass is valid, maybe we could do this by accessing an arbitrary URL like api/Configuration that needs user/pass and see if it fails? We also wouldn't need to set the new token in the auth_token if it doesn't utilize it.

Just some thoughts, still looking into the best way to do this. I will be looking to help out with this soon to gain 1.30 support for the driver that utilizes scaleiopy.

@wallnerryan
Copy link
Contributor Author

Or possibly, idk if you need to login for version, as long as username/password is correct, we could use the version to verify if its 1.30 vs 1.31?

This is against a 1.30 (without login)

(venv)[root@sclr059]#curl -k --basic --user admin:Scaleio123 https://10.13.217.59:443/api/version
"1.0"

This is against a 1.31 (without login)

[vagrant@tb]$ curl -k --basic --user admin:Scaleio123 https://192.168.50.12:443/api/version
"1.1"

@swevm
Copy link
Owner

swevm commented Jun 2, 2015

Nice find. It's also
Possible to set what version ScaleIO should use to respond to requests by setting http header. It's used at some place but need to
Be overhauled.
I have started looking at how to make use of some New 1.32 features so I have to implement API version checking anyway.

@wallnerryan
Copy link
Contributor Author

So you use this already? So its possible to set ScaleIO to use a specific version of the API?

Also, 2 things, do you think its possible to cut a release before adding any 1.30 or 1.32 support ? E.g. with current feature sets. I will want to refer to this version soon. And when you do the work for 1.32 could we make a separate branch for now? I could do the same for 1.30 work?

@swevm
Copy link
Owner

swevm commented Jun 3, 2015

I won´t add any 1.32 stuff before a new release which should be soon. Have some time constraints atm. Need to merge the pieces in v-tree branch and add a minor adjustment to IM class to support configuring syslog during installation and then I´ll create a release out of it.

Optimally I´d like to be able to identify protocol version and adopt to it. how come you need 1.30 support? 1.31 do everything that 1.30 do but better.

@wallnerryan
Copy link
Contributor Author

Sounds Good,

Do you estimate when you'd be able to? Ultimately pip installable releases would be nice too, I know as you mentioned its future roadmap.

Agreed, but just for compatibility reasons

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

2 participants