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
",
"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.