2011-09-07 10:00:25 -04:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Cloudstack
|
|
|
|
class Real
|
|
|
|
|
|
|
|
# Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.
|
|
|
|
#
|
|
|
|
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/deployVirtualMachine.html]
|
|
|
|
def deploy_virtual_machine(options={})
|
|
|
|
options.merge!(
|
|
|
|
'command' => 'deployVirtualMachine'
|
|
|
|
)
|
|
|
|
|
|
|
|
if ( securitygroupids = options.delete('securitygroupids') ).is_a?(Array)
|
2011-10-09 21:14:05 -04:00
|
|
|
options.merge!('securitygroupids' => securitygroupids.join(','))
|
2011-09-07 10:00:25 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
if ( securitygroupnames = options.delete('securitygroupnames') ).is_a?(Array)
|
|
|
|
options.merge!('securitygroupnames' => securitygroupnames.join(','))
|
|
|
|
end
|
|
|
|
|
2012-01-25 11:11:22 -05:00
|
|
|
if ( networkids = options.delete('networkids') ).is_a?(Array)
|
|
|
|
options.merge!('networkids' => networkids.join(','))
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-09-07 10:00:25 -04:00
|
|
|
request(options)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|