November 23, 2017

Set the user data for a VSI.

The script sets the user metadata for a VSI we make a simple
call the setUserMetadata() in the SoftLayer_Virtual_Guest API service

Important manual pages:

Author: SoftLayer Technologies, Inc. <>
import SoftLayer

Client configuration
Your SoftLayer API username and key.

USERNAME = 'set me'
API_KEY = 'set me'

# The user data you wish to set
userData = ["this is my user data 2"]

# The id of the VSI where you want to set the user data
virtualGuestId = 7370502

# Declaring the API client
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
virtualGuestService = client['SoftLayer_Virtual_Guest']

    # Setting the user metadata
    result = virtualGuestService.setUserMetadata(userData, id=virtualGuestId)
except SoftLayer.SoftLayerAPIError as e:
    print("Unable to set the tags faultCode=%s, faultString=%s"
          % (e.faultCode, e.faultString))


We would love to hear it
Open an issue