We're excited to announce the initial release of the knife-softlayer Ruby gem.
Knife-softlayer is a plugin for the knife utility used with Chef that allows users to launch a SoftLayer virtual server and bootstrap it in a single command. If you're new to Chef, here's a guide to get you started.
user@local> knife softlayer server create --hostname web --domain example.com --flavor medium
This is a basic example using every available default, but it works. It will launch a virtual server and register it as a Chef node (though it won't have a run list). The idea behind pushing your infrastructure into the cloud is that, ideally, you don't have to think about details that don't matter to you. We've worked hard to get the number of options you're required to supply (decisions you need to make) as low as possible, while still giving you full control over every single detail if you need it.
Unlike some other clouds, we don't take away your choices; however, we don't force you to choose if you don't want to think about it. We can't imagine why you would ever need a virtual server with 16 CPU cores and only 1GB of memory. But if that's what you need, with SoftLayer, you can do it.
This second example again launches an instance, this time specifying the number of cores, the NIC speed, the number and size of block devices, and also tells Chef to run a set of cookbooks on the instance. The virtual server is coming up with 1 core, 64GB of RAM, and 100GB of block device storage (disk space) on device 0. We're also installing git and redis on it.
user@local> knife softlayer server create -H some-host -D example.com \\ --network-interface-speed 1000 \\ --cores 1 \\ --ram 65536 \\ --block-storage 0:100 \\ --run-list 'recipe[git],recipe[redis]'
The knife-softlayer plugin will take any options that the regular bootstrap command supports, we've also added some additional options to support launching a SoftLayer virtual server.
-H,--hostnameThe hostname of the virtual server.
-D,--domainThe domain of the virtual server.
-C, --coreswill accept values from 1 - 16.
-R, --ramwill accept values [in MB] from the following list:
-B, --block-storageThe size in GB of the block storage devices (disks) for this instance.
knife softlayer flavor list --allfor a list of available sizes.
Mix and match the above as you like!
-f, --flavorChoose from a list of
xlargeand you can skip the three options above. Alternatively, choose a flavor that gets two of these right, and override the one you want to change by specifying only that flag.
user@local> knife softlayer server create --hostname web --domain example.com --flavor medium --cores 8
knife softlayer flavor list for details on what each of these flavors will give you.
-n,--network-interface-speedin MB. See
knife softlayer flavor list --allfor available speeds.
-O,--os-codeDefaults to UBUNTU_LATEST. See
knife softlayer flavor list --allfor available OS images.
--new-global-ipProvision a new Global IP address on your SoftLayer account and route it to the virtual server being created.
--assign-global-ipPass an existing Global IP address to this option to route it to the virtual server being created.
--single-tenantCreate a virtual server that has a private node, which means a dedicated physical host (get rid of those noisy neighbors).
--san-storageDon't bother with any local disks, use the SAN, instead of local storage, for the virtual servers instance storage.
knife softlayer server create --help for the full list of awesome things.
Combining the power of Chef with the flexibility of the SoftLayer API in a single utility brings a whole new level of fun to automating things in the SoftLayer cloud. Let us know what awesome things you're doing! We're on Twitter @softlayer.