Skip to content

Commit

Permalink
[bat] Add support for OpenStack manual networks
Browse files Browse the repository at this point in the history
  • Loading branch information
frodenas committed Apr 1, 2013
1 parent e142a52 commit f12939a
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 6 deletions.
47 changes: 47 additions & 0 deletions bat/README.md
Expand Up @@ -72,6 +72,49 @@ properties:
security_groups:
- bat
```

On OpenStack with DHCP:
```yaml
---
cpi: openstack
properties:
static_ip: 54.235.115.62 # floating IP to use for the bat-release jobs
uuid: 25569986-a7ed-4529-ba84-8a03e2c6c78f # BAT_DIRECTOR UUID
pool_size: 1
stemcell:
name: bosh-stemcell
version: latest
instances: 1
key_name: bosh # OpenStack key name
mbus: nats://nats:0b450ada9f830085e2cdeff6@10.42.49.80:4222 # Not used now, but don't remove
```

On OpenStack with manual networking (requires Quantum):
```yaml
---
cpi: openstack
properties:
static_ip: 54.235.115.62 # floating IP to use for the bat-release jobs
uuid: 25569986-a7ed-4529-ba84-8a03e2c6c78f # BAT_DIRECTOR UUID
pool_size: 1
stemcell:
name: bosh-stemcell
version: latest
instances: 1
key_name: bosh # OpenStack key name
mbus: nats://nats:0b450ada9f830085e2cdeff6@10.42.49.80:4222
network:
cidr: 10.0.1.0/24
reserved:
- 10.0.1.2 - 10.0.1.9
static:
- 10.0.1.10 - 10.0.1.30
gateway: 10.0.1.1
net_id: 4ef0b0ec-58c9-4478-8382-2099da773fdd #
security_groups:
- default
```

## EC2 Networking Config

### On EC2 with AWS-provided DHCP networking
Expand All @@ -81,6 +124,10 @@ Add TCP port `4567` to the **default** security group.
Create a **bat** security group in the same VPC the BAT_DIRECTOR is running in. Allow inbound access to TCP ports
`22` and `4567` to the bat security group.

## OpenStack Networking Config

Add TCP ports `22` and `4567` to the **default** security group.

## Running BAT

When all of the above is ready, running `bundle exec rake bat:env` will verify environment variables are set correctly.
Expand Down
45 changes: 39 additions & 6 deletions bat/templates/openstack.yml.erb
Expand Up @@ -7,11 +7,14 @@ release:
version: <%= properties.release || "latest" %>

compilation:
workers: 1
workers: 2
network: default
reuse_compilation_vms: true
cloud_properties:
instance_type: m1.small
<% if properties.key_name %>
key_name: <%= properties.key_name %>
<% end %>

update:
canaries: <%= properties.canaries || 1 %>
Expand All @@ -21,22 +24,49 @@ update:
max_errors: 1

networks:

- name: static
type: vip
cloud_properties: {}

- name: default
<% if p('network.net_id', false) %>
type: manual
subnets:
- range: <%= properties.network.cidr %>
reserved:
<% properties.network.reserved.each do |range| %>
- <%= range %>
<% end %>
static:
<% properties.network.static.each do |range| %>
- <%= range %>
<% end %>
gateway: <%= properties.network.gateway %>
dns:
<% if_p('dns_nameserver') do |dns_nameserver| %>
- <%= dns_nameserver %>
<% end %>
<% if_p('network.dns') do |dns| %>
- <%= dns %>
<% end %>
cloud_properties:
security_groups: <%= p('network.security_groups') %>
net_id: <%= p('network.net_id') %>
<% else %>
type: dynamic
<% if_p('dns_nameserver') do |dns_nameserver| %>
dns:
- <%= dns_nameserver %>
<% end %>
<% if properties.security_group %>
<% if properties.security_groups %>
cloud_properties:
security_groups:
- <%= properties.security_group %>
- <%= properties.security_groups %>
<% else %>
cloud_properties: {}
<% end %>
- name: static
type: vip
cloud_properties: {}
<% end %>

resource_pools:
- name: common
Expand All @@ -47,6 +77,9 @@ resource_pools:
version: <%= properties.stemcell.version %>
cloud_properties:
instance_type: m1.small
<% if properties.key_name %>
key_name: <%= properties.key_name %>
<% end %>
<% if properties.password %>
env:
bosh:
Expand Down

0 comments on commit f12939a

Please sign in to comment.