Blitzem allows you to control your cloud servers and load balancers as a complete environment, rather than requiring you to control nodes individually. Whole environments can be controlled with a single command.
Your environment is specified as a simple, easy-to-read configuration file, allowing you to share, version-control, review and track changes, and replicate an environment's infrastructure configuration as of specific points in time.
You bring your provisioning tool of choice (e.g. Puppet, Chef, CFEngine); blitzem will manage the infrastructure for it to run on.
blitzem has currently been tested with Rackspace Cloud and Amazon EC2, and could support other Infrastructure-as-a-Service providers in the future.
blitzem was created at the end of 2011 following a couple of years' experience with using various cloud providers for development and production infrastructure. We generally controlled our infrastructure via the cloud providers' web consoles or simple API scripting, but wanted a way to reduce the administrative overhead.
blitzem is open source, and released under a BSD Licence (see LICENCE.txt)
It is suggested that blitzem always be used in conjunction with a package configuration management tool (e.g. Puppet, Chef, CFEngine) to install packages and detailed configuration files on provisioned nodes.
examples/load_balanced/environment.groovy. Hover over the '?' symbols for an explanation of each element:
import org.blitzem.model.*
import org.blitzem.model.thirdparty.*
import static org.blitzem.model.Size.*
/* After raising the load balancer and nodes, requests to the load
* balancer on port 80 should be randomly distributed across web1
* and web2, and the returned index.html page should be the node hostname.
*
* To verify, run `blitzem up` and put the public IP address of the
* load balancer into a web browser.
*/
Defaults.DEFAULTS["osVersion"] = "11.04"
Defaults.DEFAULTS["provisioning"] = [new ScriptExecution("apt-get update; apt-get install dtach; mkdir web; cd web; hostname > index.html; dtach -n /tmp/simple_http.worker python -m SimpleHTTPServer 8080")] // ?
new LoadBalancer([ // ?
name:"web-lb1",
tags:["web"], // ?
appliesToTag: "web", // ?
protocol: "http",
port: 80,
nodePort: 8080
])
new Node([ // ?
name:"web1",
tags:["web", "peak"], // ?
size:ram(512) // ?
])
new Node([
name:"web2",
tags:["web", "peak"],
size:ram(256)
])
examples/load_balanced folder, execute the command
blitzem up| Command | Description |
|---|---|
help |
Display a summary of blitzem commands. |
status |
For the current environment file, display the state of all defined nodes and load balancers. |
up name/tag |
If it is not already up, create a new instance of the node(s) or load balancer(s) with the provided name or tag. If no name/tag is provided, this command will apply to all nodes and load balancers. |
down name/tag |
If it is currently up, destroy the instance of the node(s) or load balancer(s) with the provided name or tag.If no name/tag is provided, this command will apply to all nodes and load balancers. |
blitzem requires your cloud provider credentials to be stored separately from
your environment configuration file. This can be used to enable sensitive credentials
to be distributed appropriately, whilst still enabling visibility and reuse of
environment configuration across teams. For blitzem to operate, you need to ensure
that a file similar to the following is placed at ~/.blitzem/config.properties:
# config.properties template (created for blitzem version 0.3) # Valid values: cloudservers-uk, aws-ec2 compute-provider= compute-accesskeyid= compute-secretkey= # Valid values: cloudloadbalancers-uk, aws-ec2 loadbalancer-provider= loadbalancer-accesskeyid= loadbalancer-secretkey= # Valid values: rackspace-uk, aws provider=rackspace-uk
The blitzem environment file should be named environment.groovy. It should either be present in the working directory where blitzem is run from, or should be referred to using a command line option:
blitzem --source=/some/other/dir/environment.groovy up.
| Name | Parameters | Description |
|---|---|---|
| Node | A compute node / virtual server | |
| name | The name that blitzem should use (may or may not map directly to the name of the compute node in the cloud) | |
| tags | Specifies tag groups that this node should respond to, for example when executing commands such as 'blitzem up web' | |
| size | A minimum size for this node; e.g.: ram(1024) or
ramAndCores(1024,2) |
|
| os | OS criteria that should be used when selecting a base image, e.g.:
new Os([ family: 'UBUNTU', version: '11.04', os64Bit: true ]) |
|
| LoadBalancer | A load balancer distributes incoming requests across compute nodes | |
| name | The name that blitzem should use (may or may not map directly to the name of the load balancer in the cloud) | |
| tags | Specifies tag groups that this load balancer should respond to, for example when executing commands such as 'blitzem up web' | |
| appliesToTag | Specify which tag this load balancer should apply to - all nodes with this tag will be load-balanced | |
| protocol | What protocol is being load balanced; either http or tcp | |
| port | The externally accessible port the load balancer will listen on | |
| nodePort | The port on compute nodes which incoming requests should be routed to |
/usr/local/blitzem or ~/blitzem)export BLITZEM_HOME=/usr/local/blitzem # (or whereever you unpacked the archive to) export PATH=$BLITZEM_HOME/bin:$PATH
. ~/.bashrcblitzem help. You should see a help message if it is correctly set up~/.blitzem/config.properties
file.
cd $BLITZEM_HOME/examples/load_balanced
blitzem up
Node status
Node name Status Public IP Address(es) Private IP Address(es) Tags
========= ====== ===================== ====================== ===========
web1 UP [164.177.147.234] [10.177.141.44] [web, peak]
web2 UP [164.177.147.237] [10.177.141.54] [web, peak]
web3 UP [164.177.147.239] [10.177.141.56] [web, peak]
web4 UP [164.177.147.241] [10.177.141.58] [web, peak]
Load Balancer status
LB name Status IP Address Tags Applies to nodes tagged Type Location
======= ====== ================ ===== ======================== ==== ========
web-lb1 UP [31.222.175.127] [web] web LB [GB-SLG]Instructions coming soon
Visit the blitzem project on Github or email rich.north+blitzem@gmail.com with any questions or comments.
The author, Richard North, is an IT Consultant based in London, UK.