November 23, 2017

Remove access to Consistent Performance Storage iSCSI.

This script removes the access to Consistent Performance Storage iSCSI from a virtual guest by calling to
SoftLayer_Network_Storage::removeAccessFromVirtualGuest method.

See below references for more details.
Important manual pages:
@Author: SoftLayer Technologies, Inc. <>
# So we can talk to the SoftLayer API:
import SoftLayer

# For nice debug output:
import pprint

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

# Create a client instance
client = SoftLayer.Client(username=API_USERNAME, api_key=API_KEY)
Set the storage Id to remove the access from a virtual instance, you can get
a list of storage with SoftLayer::getNetworkStorage
storageId = 4379484
Set the server id which will be detached from the storage, retrieve a list of
virtual guests by SoftLayer_Account::getVirtualGuests
serverId = 7598482
virtualGuestTemplate = {'id': serverId}
    result = client['SoftLayer_Network_Storage'].removeAccessFromVirtualGuest(virtualGuestTemplate, id=storageId)
    print("Access removed  to storage")
except SoftLayer.SoftLayerAPIError as e:
    print("Error cannot remove access  faultCode=%s, faultString=%s"
          % (e.faultCode, e.faultString))


We would love to hear it
Open an issue