Knife IBM SCE Extensions

Description:

IBM SCE tools for Chef’s knife.

Installation:

Be sure you are running the latest version Chef. Versions earlier than 0.10.0 don’t support plugins:

gem install chef

This plugin is distributed as a Ruby Gem. To install it, run:

gem install knife-sce

Depending on your system’s configuration, you may need to run this command with root privileges.

Configuration:

In order to communicate with the IBM’s SCE API you will have to tell Knife about your IBM username and password. The easiest way to accomplish this is to create some entries in your knife.rb file:

knife[:ibm_username] = "Your IBM username"
knife[:ibm_password] = "Your IBM password"

If your knife.rb file will be checked into a SCM system (ie readable by others) you may want to read the values from environment variables:

export IBM_USERNAME=<your IBM SCE username>
export IBM_PASSWORD=<your IBM SCE password>

knife[:ibm_username] = "#{ENV['IBM_USERNAME']}"
knife[:ibm_password] = "#{ENV['IBM_PASSWORD']}"

Supported knife.rb configuration options

knife[:ibm_username] = <your IBM SCE username>
knife[:ibm_password] = <your IBM SCE password>
knife[:sce_image] = <SCE image ID>
knife[:sce_flavor] = <SCE flavor>
knife[:sce_location_id] = <SCE location>
knife[:sce_ssh_user] = <SCE user>
knife[:sce_max_timeout] = <SCE timeout> # use high value, SCE 2.2 requires long timeouts, 6000 should be enough

Subcommands:

knife sce server create (options)

Provisions a new server in the IBM SCE and then performs a Chef bootstrap (using the SSH protocol). The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists (provided by the provisioning). It is primarily intended for Chef Client systems that talk to a Chef server. By default the server is bootstrapped using the ubuntu10.04-gems template. This can be overridden using the -d or --template-file command options.

knife sce server delete SERVER [SERVER] (options)

Deletes an existing server in the currently configured SCE account. PLEASE NOTE - By default, this does not delete the associated node and client objects from the Chef server. To do so, add the --purge flag.

knife sce server list (options)

Outputs a list of all servers in the currently configured SCE account. PLEASE NOTE - this shows all instances associated with the account, some of which may not be currently managed by the Chef server.

knife sce instance data (options)

Generates instance metadata in meant to be used with Opscode’s custom SCE image. This will read your knife configuration ~/.chef/knife.rb for the validation certificate and Chef server URL to use and output in JSON format. The subcommand also accepts a list of roles/recipes that will be in the node’s initial run list.

knife sce key create KEYNAME

Create a key pair of a given name. The response will contain private key which you will have to save somewhere if you would like to use it later on.

knife sce key delete KEYNAME

Delete a key pair of a given name.

knife sce key get KEYNAME

Get all the details of a given key.

knife sce key list

List all key pairs created by the current SCE account.

knife sce location list (options)

List available locations (data centers).

knife sce image describe IMAGE_ID [IMAGE_ID]

Outputs all known information about the image. Use this command to learn what flavors are available for a given image.

knife sce storage offerings (options)

Lists available storage offerings for current SCE account.

knife sce volume attach INSTANCE_ID VOLUME [VOLUME]

Attach single or multiple volumes to an instance. Volumes are not automatically mounted.

knife sce volume create (options)

Issue a volume creation request. To learn what is the offer id and supported size, use knife sce storage offerings.

knife sce volume delete VOLUME [VOLUME]

Delete single or multiple volumes. Volumes must be Detached before the delete request is issued.

knife sce volume detach INSTANCE_ID VOLUME [VOLUME]

Detach single or multiple volumes.

knife sce volume list (options)

List SCE volumes.

knife sce vlan list

List SCE VLANs

License:

Author

Rad Gruchalski (<[email protected]>)

License

Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.