-2

I need to provision a server through API with the configuration of RAM:16GB, OS: Centos5.6 Quad Core 64 bit, HDD:1TB.

API request which I used https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

Request Post data:

{"parameters":[{"hostname":"jmblw","domain":"micron.com","startCpus":4,"maxMemory":16,"blockDevices":[{"device":0,"diskImage":{"capacity":100}},{"device":2,"diskImage":{"capacity":1000}}],"hourlyBillingFlag":true,"localDiskFlag":true,"operatingSystemReferenceCode":"CENTOS_5_64","datacenter":{"name":"sng01"}}]}

RESPONSE :

{
"error": "Unable to find a price for block device 2.",
"code": "SoftLayer_Exception_NotFound"
}

Can you please tell me how I can povision a server with HDD 1 TB. and please send me the Request body post data's structure

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
shalini
  • 35
  • 1
  • 9
  • i would try to change device":2, to device":1, , you have a device id 0 and 2 specified, but not 1... or try 1 and 2. but not 0 and 2 – hanshenrik Nov 28 '15 at 06:26
  • If im trying with device : 1 it showing error response RESPONSE: { "error": "Invalid value provided for 'blockDevices.device'. Block device 1 is reserved for the SWAP disk.", "code": "SoftLayer_Exception_InvalidValue" } – shalini Nov 28 '15 at 07:25
  • oh, that explains it. nvm me – hanshenrik Nov 28 '15 at 07:37

1 Answers1

0

SAN disks have the configuration capacity for 1TB (for second disk) but "Local" disks have a 300GB as maximum. If we change "localDiskFlag": true to “false”, the request should work.

Please try the following:

https://[usename]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

Method: POST

Json:

{
  "parameters": [
    {
      "hostname": "jmblw",
      "domain": "micron.com",
      "startCpus": 4,
      "maxMemory": 16,
      "blockDevices": [
        {
          "device": 0,
          "diskImage": {
            "capacity": 100
          }
        },
        {
          "device": 2,
          "diskImage": {
            "capacity": 1000
          }
        }
      ],
      "hourlyBillingFlag": true,
      "localDiskFlag": false,
      "operatingSystemReferenceCode": "CENTOS_5_64",
      "datacenter": {
        "name": "sng01"
      }
    }
  ]
}
mcruz
  • 1,534
  • 2
  • 11
  • 14