November 23, 2017

Create a VSI using the simplified way with tags.

The script creates a simple VSI using the SoftLayer_Virtual_Guest::createObject method
along with tags.

Important manual pages:

Author: SoftLayer Technologies, Inc. <>
import SoftLayer

# For nice debug output:
from pprint import pprint as pp

# Your SoftLayer API username and key.
API_USERNAME = 'set me'

# Generate one at
API_KEY = 'set me'

object_server = {
    "datacenter": {
        "name": "dal05"
    "hostname": "testborrame",
    "domain": "",
    "startCpus": 1,
    "maxMemory": 1024,
    "hourlyBillingFlag": True,
    "localDiskFlag": True,
    "operatingSystemReferenceCode": "UBUNTU_LATEST",
            "tag": ["mytag"]

client = SoftLayer.create_client_from_env(username=API_USERNAME, api_key=API_KEY)
virtualGuestService = client['SoftLayer_Virtual_Guest']

To test the input parameters call the SoftLayer_Virtual_Guest::generateOrderTemplate method
when you are ready to create the server call the SoftLayer_Virtual_Guest::createObject method.
    result = virtualGuestService.generateOrderTemplate(object_server)
    pp (result)
except SoftLayer.SoftLayerAPIError as e:
    If there was an error returned from the SoftLayer API then bomb out with the
    error message.
    print("Unable to create the VSI. "
          % (e.faultCode, e.faultString))


We would love to hear it
Open an issue