drnic/bosh-gen — pull request #2 by BrianMMcClain (2012-05-22 05:10:33+00:00)
Title: vSphere support in manifest files

This branch adds support for generating manifest files to deploy a release to vSphere. The following flags were also added to `bosh-gen manifest`

`
-c, [--cpi=CPI] # Specify the CPI fields to be generated, e.g. "aws" or "vsphere"
-r, [--range=RANGE] # IP Netmask
-g, [--gateway=GATEWAY] # IP Gateway
[--dns=one two three] # DNS Servers
-w, [--workers=N] # Number of worker VMs to spawn when compiling packages
-n, [--network=NETWORK] # [vSphere Only] Network to bind VMs to
`

While not the cleanest code, it works, and I did a few tests to make sure I didn't break anything AWS related, however it's not a bad idea to do so, since I didn't have a chance to do so. I did generate a couple AWS manifests (w/ and w/o static IPs) and just did a diff against them, and this branch still seems to generate AWS manifests as it did before. This has been tested deploying to vSphere 5 with only ESXi 5 hosts, however I believe any limitations would be seen in the CPI before these manifests.

There's a couple things to keep in mind...

1. It is expected that vSphere manifests will only have static IP assignment. This is simply because I havn't found a good example for dynamic IP assignment in vSphere manifests. Once I find/am given one, I'll submit another pull request.
2. For vSphere deployments, the -c, -r, -g, --dns and -n flags are REQUIRED. This information is needed for basic static IP assignment, as well as the -n flag to know which network to bind a VM to in vSphere
3. AWS is the default CPI (I wanted to allow previous examples to still be valid, plus AWS was here first :) ), so when generating vSphere manifests, the "-c vsphere" is required.

An example command used to generate a manifest for vSphere is as follows...

bosh-gen manifest redis-dev redis-on-demand xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxx -c vsphere -a 192.168.0.100 -r 192.168.0.0/24 -g 192.168.0.1 --dns 192.168.0.1 192.168.0.2 -n "Development Network" -w 1