We are seeing same issue with the SoftLayer Ruby API as in this post:
CLI - Error when disk parameter is in use
This code can reproduce the issue:
#!/usr/bin/ruby
require 'softlayer_api'
def image_template_id(sl_client, image_template_name)
templates = sl_client['Account'].getBlockDeviceTemplateGroups
templates.each do | template |
if image_template_name == template['name']
return SoftLayer::ImageTemplate.template_with_id(template['id'], {:client => sl_client})
end
end
return nil
end
sl_username = "USER"
sl_apikey = "API-KEY"
sl_client = SoftLayer::Client.new(username: sl_username, api_key: sl_apikey)
server_order = SoftLayer::VirtualServerOrder.new(sl_client)
server_order.hostname = "test"
server_order.domain = "mycompany.com"
server_order.datacenter = SoftLayer::Datacenter.datacenter_named("par02", sl_client)
server_order.cores = 2
server_order.memory = 4
server_order.image_template = image_template_id(sl_client, "IMAGE NAME")
server_order.disks = [100, 100]
puts server_order.verify
which results in this in this error:
/usr/share/ruby/xmlrpc/client.rb:414:in `call': Invalid value provided for 'blockDevices'. Block devices may not be provided when using an image template. (XMLRPC::FaultException)
from /fs/home/richb/.gem/ruby/1.9.1/gems/softlayer_api-3.0.0/lib/softlayer/Service.rb:281:in `call_softlayer_api_with_params'
from /fs/home/richb/.gem/ruby/1.9.1/gems/softlayer_api-3.0.0/lib/softlayer/Service.rb:210:in `method_missing'
from /fs/home/richb/.gem/ruby/1.9.1/gems/softlayer_api-3.0.0/lib/softlayer/VirtualServerOrder.rb:122:in `verify'
from ./sltest:29:in `<main>'
I understand that the API is not allowing you to specify disks but this is something you can do with an image template via the SoftLayer portal so is there any way to do this via the API?