November 23, 2017


# Create a transaction to migrate an instance from one dedicated host to another dedicated host.
# Important manual pages:
# License:
# Author: SoftLayer Technologies, Inc. <>

require 'softlayer_api'

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

vsi_id_to_migrate = 37117661
dedicated_host_target = 10009

# Create a SoftLayer API client object
client = USERNAME, api_key: API_KEY)
service = client['SoftLayer_Virtual_Guest']

  # Create the transaction to migrate the vsi to another dedicated host.
  response = service.object_with_id(vsi_id_to_migrate).migrateDedicatedHost dedicated_host_target

  puts "Transaction to migrate vsi was created: #{response}"

rescue StandardError => exception
  puts "Unable to place order: #{exception}"


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue