This post is more than 5 years old
3 Posts
0
2580
October 16th, 2015 02:00
How to add an SDS using the REST interface?
Hi,
I am using Scale IO version 1.32.403.2 and would like to configure my cluster via the gateway using the REST API.
Configuration steps worked well up to the point where I needed to add an SDS.
The REST API Documentation states the following properties as mandatory:
- protectionDomainId
- ipList (name of the property for POST: sdsIpList), which should be a list of SdsIp {"ip", "role"}
I tried to use the following command to add the SDS:
curl -k -v --basic --user admin:$TOKEN -X POST -H "Content-Type: application/json" -d '{"name":"mySDS","sdsIpList":[{"ip":"192.168.0.5","role":"all"}],"protectionDomainId":"8d7b690d00000000","forceClean":"TRUE"}' https:// /api/types/Sds/instances
This however fails with the following message:
"Wrong command parameters. You can check that you are using the correct parameters, by consulting the help for the command."
The MDM trace log contains:
15/10 09:21:21.689105 mosEventLog_PostInternal:00555: New event added. Message: "Command add_sds received, User: 'admin'. [60100]". Additional info: "protection_domain with ID 8d7b690d00000000 fault_set N/A New SDS name: N/A Hostnames: Port: 7072 Devices: Test mode: 'No test' Test time: 0 Cache is enabled, Cache size: 128 MB, Number of IO Buffs: 1" Severity: Info
15/10 09:21:21.689111 ctrl_CreateTgt:00310: ADD_SDS: No host names provided
15/10 09:21:21.689126 mosEventLog_PostInternal:00555: New event added. Message: "Command add_sds was not successful. Error code: Wrong command parameters. You can check that you are using the correct parameters, by consulting the helpfor the command. [60100]". Additional info: "ID: 0000000000000000" Severity: Warning
I assume that the ipList (or sdsIpList) property is the problem here, but I could not figure out what is wrong with this parameter the way I provided it.
Has anyone succeeded adding SDS using the REST interface? Could you share the code how to do that?
Big thanks in advance!
Have a great weekend,
/Nicolai
tomer__engineer
155 Posts
1
October 19th, 2015 02:00
Hi,
You are missing the deviceInfoList parameter in your JSON:
/api/types/Sds/instance
POST
According to “Required\Optional for POST” column plus:
Required:
deviceInfoList – list of pairs: "deviceName" , “storagePoolId"
Optional:
forceClean – TRUE or FALSE
testTimeSecs - The maximal test run-time in seconds or 128 MB data.
Default limit is 10 seconds. Not relevant for noTest.
testMode – testOnly or noTest or testAndActivate.
testOnly, Devices will be tested but not used. Later issue activateDevice
to start using their capacity.
noTest, Devices capacity will be used without any device testing.
This is an example I have:
curl -k -v -g --basic --user admin:$token -H "Content-Type:application/json" -d '{"protectionDomainId":"ID", "sdsIpList":[{"ip":"IP","role":"all"}],"deviceInfoList":[{"devicePath":"/dev/sdb","storagePoolId":"ID","deviceName":"xyz"}]}' https://GW-IP/api/types/Sds/instances
nicsch
3 Posts
0
October 22nd, 2015 07:00
Hi,
thanks a lot for this answer. However, I still get exactly the same error message after using your example and adapting it to my environment.
Command:
curl -k -v -g --basic --user admin:$TOKEN -H "Content-Type:application/json" -d '{"protectionDomainId":"8d7b690d00000000", "sdsIpList":[{"ip":"192.168.0.5","role":"all"}],"deviceInfoList":[{"devicePath":"/dev/sda","storagePoolId":"9e8a5aaf00fff000","deviceName":"myDev"}],"forceClean":"TRUE"}' https:// /api/types/Sds/instances
Error: (as usual)
{"message":"Wrong command parameters. You can check that you are using the correct parameters, by consulting the help for the command.","httpStatusCode":500,"errorCode":62}
Trace on MDM:
22/10 15:47:44.439669
mosEventLog_PostInternal:00555: New event added. Message: "Command add_sds
received, User: 'admin'. [688041]". Additional info:
"protection_domain with ID 8d7b690d00000000 fault_set N/A New SDS name:
N/A Hostnames: Port: 7072 Device: myDev (/dev/sda) force-clean Test mode: 'No
test' Test time: 0 Cache is enabled, Cache size: 128 MB, Number of IO Buffs:
1" Severity: Info
22/10 15:47:44.439676 ctrl_CreateTgt:00310: ADD_SDS: No host names provided
22/10 15:47:44.439697 mosEventLog_PostInternal:00555: New event added. Message:
"Command add_sds was not successful. Error code: Wrong command parameters.
You can check that you are using the correct parameters, by consulting the help
for the command. [688041]". Additional info: "ID: 0000000000000000"
Severity: Warning
A similar operation works when using the ScaleIO CLI.
Seeing the error "ADD_SDS: No host names provided", I still assume that somehow the provided IP addresses are not interpreted correctly. Most of the other command parameters are reflected in the trace on the MDM, while Hostnames: is empty.
Best regards,
/Nicolai
tomer__engineer
155 Posts
0
October 25th, 2015 01:00
The version you are using (1.32.403.2) is 1.32 GA (released few months ago). We've recently uploaded version 1.32.2:
Can you please install this version and tell us if this issue still happens?
We will try to reproduce this issue in our labs with 1.32 GA (1.32.403.2).
tomer__engineer
155 Posts
1
October 26th, 2015 05:00
Hi,
1. Are you using the same version for the SIO-GW (REST server) + your ScaleIO system (MDM)?
They all must be aligned on same version: 1.32 GA (1.32.403.2), or 1.32.2 (1.32-2451.4), not mixed.
2. My previous example had a small typo, can you please run this example again:
curl -k -v -g --basic --user admin:$token -H "Content-Type:application/json" -d '{"protectionDomainId":"ID", "sdsIpList":[{"SdsIp":{"ip":"IP","role":"all"}}],"deviceInfoList":[{"devicePath":"/dev/sdb","storagePoolId":"ID", "deviceName":"xyz"}]}' https://GW-IP/api/types/Sds/instances
tomer__engineer
155 Posts
2
October 27th, 2015 04:00
We will make sure to add this example in our Release notes and/or User guide for our future versions.
nicsch
3 Posts
0
October 29th, 2015 13:00
Thanks a lot to both of you!!! It works now for me as well, thanks to your advice.