I am using Softlayer's command-line client(v5.1.0) to create new virtual machines. When I pass several parameters along, it always returns a timeout error. However, the VM is successfully created. Is this a bug? I run this within a Jenkins job so I'd like to have a way to know if the command was successful.
slcli --really vs create --hostname=portaltest --domain=XXXXXX.net
--cpu 1 --memory 1024 --datacenter=fra02 --billing=hourly --image=XXXXX --key=jenkins --vlan-public=XXXXX --vlan-private=XXXXX
returns:
TransportError(0): HTTPSConnectionPool(host='api.softlayer.com', port=443): Read timed out. (read timeout=5.0)
When first setting up the API client (with slcli setup
), it asks you for a timeout. The default it zero, which means that if the SLAPI takes forever to satisfy your request, slcli will wait forever. You seem to have configured it to time out after 5 seconds. As you have noticed, this is not enough time for certain API calls. The resolution to your problem is to increase the timeout value, or set it to 0.
You can do this by running slcli setup
and pushing enter until you get to where it asks about timeout. Note: pressing enter will use the currently configured values.
It should look like this:
slcli setup
Username [testuser]:
API Key or Password [PEa7eIG4VbQB8m7MiKdZbU4N4EKTzTI4MWqXOtX7qW8h6SMSjUvWzgU5171N2Bma]:
Endpoint (public|private|custom) [public]:
Timeout [5.0]: 0
:..............:..................................................................:
: name : value :
:..............:..................................................................:
: Username : testuser :
: API Key : PEa7eIG4VbQB8m7MiKdZbU4N4EKTzTI4MWqXOtX7qW8h6SMSjUvWzgU5171N2Bma :
: Endpoint URL : https://api.softlayer.com/xmlrpc/v3.1/ :
: Timeout : 0 :
:..............:..................................................................:
Are you sure you want to write settings to "/Users/testuser/.softlayer"? [Y/n]:
Configuration Updated Successfully