I am trying to create a VSI with vGPU. What field in the JSON payload do I pass in on the POST to create a vGPU VSI? What field in the JSON payload do I interrogate on a get that indicates the VSI is a vGPU device?
2 Answers
To create a new VSI using GPU, you can use this rest api:
Method: POST
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/verifyOrder
Body: Json
{
"parameters":[
{
"orderContainers":[
{
"complexType":"SoftLayer_Container_Product_Order_Virtual_Guest",
"location":"DALLAS13",
"packageId":835,
"presetId": 405,
"prices":[
{
"id":45466
},
{
"id":2202
},
{
"id":204853
},
{
"id":204853
},
{
"id":204853
},
{
"id":204853
},
{
"id":1800
},
{
"id":273
},
{
"id":55
},
{
"id":58
},
{
"id":420
},
{
"id":418
},
{
"id":21
},
{
"id":57
},
{
"id":905
}
],
"quantity":1
}
]
}
]
}
The GPU option is only available in the DALLAS13 location and you have to add the attribute "presetId", is there where the flavor GPU is added.
The option ACL1 and AC1 are selected for GPU.
e.g
AC1.8x60x25
it means (8 x 2.0 GHz Cores, 60 GB RAM , 25 GB (SAN) FIRST DISK)
To get the GPU presetId values you can use this rest api:
Method: GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/835/getActivePresets
You can search the GPU option by ACL1 o AC1.
The result will be:
{
"description": "AC1.8x60x25\r\n",
"id": 405,
"isActive": "1",
"keyName": "AC1_8X60X25",
"name": "AC1.8x60x25",
"packageId": 835
},
And you can use this rest api to know the characteristics of the GPU, searching by the name:
e.g "name": "AC1.8x60x25"
Method: GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/getCreateObjectOptions
To know that the VSI is a GPU you can use this rest api:
Method: GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/[virtualGuestId]/getObject?objectMask=mask[billingItem[orderItem[preset]]]
You have to search by the preset value.

- 718
- 1
- 4
- 8
-
I was hoping I didn't have to change my current way of creating a Virtual Guest in SoftLayer. Today I use the URL https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest with a POST method – Gary Sutherland Apr 03 '18 at 19:17
-
The JSON payload is { "parameters" : [ { "hostname" : "garycs-test", "domain" : "sl.cloud9.ibm.com", "startCpus" : 2, "maxMemory" : 4, "hourlyBillingFlag" : "true", "operatingSystemReferenceCode" : "CENTOS_7_64", "blockDevices" : [ { "device" : "0", "diskImage" : { "capacity" : 100 I can't post all of teh JSON payload. – Gary Sutherland Apr 03 '18 at 19:18
You can use this rest api to create a new VSI with GPU using the method createObject of the SoftLayer_Virtual_Guest service.
Method: POST
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/createObject
Body: Json
{
"parameters": [
{
"hostname": "test",
"domain": "test.local",
"datacenter": {
"name": "dal13"
},
"hourlyBillingFlag": "true",
"operatingSystemReferenceCode": "CENTOS_7_64",
"networkComponents": [
{
"maxSpeed": 1000
}
],
"privateNetworkOnlyFlag": "true",
"supplementalCreateObjectOptions": {
"flavorKeyName": "AC1_8X60X25"
}
}
]
}
You have to add the GPU value in the attribute "flavorKeyName".
To get the "flavorKeyName" you can use the rest api that is above.
"AC1_8X60X25"
it means (8 x 2.0 GHz Cores, 60 GB RAM , 25 GB (SAN) FIRST DISK)

- 718
- 1
- 4
- 8