audiolize / vagrant-softlayer

This is a Vagrant plugin that adds a SoftLayer provider to Vagrant, allowing Vagrant to control and provision SoftLayer CCI instances.
MIT License
42 stars 15 forks source link

[enhancement] Add support for blockDevices option in createobject #3

Closed ju2wheels closed 10 years ago

ju2wheels commented 10 years ago

Without setting the blockDevices, it chooses the smallest disk size and we have no way to specify the sizes of the additional allowable disks.

Something like: sl.blockDevices = [ 0=> 100, 2=>25 ]

The SL CLI lists the following as the allowed combinations: local disk(0) : 25,100
local disk(2) : 25,100,150,200,300 san disk(0) : 25,100
san disk(2) : 10,20,25,30,40,50,75,100,125,150,175,200,250,300,350,400,500,750,1000,1500,2000 san disk(3) : 10,20,25,30,40,50,75,100,125,150,175,200,250,300,350,400,500,750,1000,1500,2000 san disk(4) : 10,20,25,30,40,50,75,100,125,150,175,200,250,300,350,400,500,750,1000,1500,2000 san disk(5) : 10,20,25,30,40,50,75,100,125,150,175,200,250,300,350,400,500,750,1000,1500,2000

JSON example here: http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject/

emyl commented 10 years ago

Hey there, would you like to try to implement the feature yourself and make a pull request? I'll be happy to review it!

Here are the starting points: https://github.com/audiolize/vagrant-softlayer/blob/master/lib/vagrant-softlayer/config.rb https://github.com/audiolize/vagrant-softlayer/blob/master/lib/vagrant-softlayer/action/create_instance.rb

ju2wheels commented 10 years ago

Hi emyl, yes I actually started over the weekend on a few enhancements I want to push but im waiting on corporate approval first before I can make the pushes. Im in the process of finishing up a vagrant-softlayer-boxes tool that taps the API and generates base boxes based on the create-options and the available public/private compute/flex images. Ill probably start on implementing the above blockDevices feature and also the blockDeviceTemplateGroup.globalIdentifier to select the images based on the exported data. Have something hopefully by end of the week depending on how long the approval process takes.

ju2wheels commented 10 years ago

What are your thoughts on either tapping the data in SoftLayer_Virtual_Guest.getCreateObjectOptions, SoftLayer_Account.getBlockDeviceTemplateGroups, SoftLayer_Virtual_Guest_Block_Device_Template_Group.getPublicImages to update the SoftLayer config validation to validate the requested template settings are correct OR which is probably the better way to use SoftLayer_Virtual_Guest::generateOrderTemplate and generate a template object to send to verifyOrder which I think would do that for us. If its something thats useful I dont know where would be the best place to put that (create instance call method or config validate if the template is available to that method)?

Otherwise people could potentially be able to set unacceptable combinations for disks when using the create object template.

ju2wheels commented 10 years ago

@emyl : closing this as pull request should resolve this.