Skip to content

Commit

Permalink
Merge pull request #101 from cloudfoundry/openstack_fixes
Browse files Browse the repository at this point in the history
Openstack fixes
  • Loading branch information
Amit-PivotalLabs committed Apr 2, 2013
2 parents 1fd7038 + f12939a commit 140ab42
Show file tree
Hide file tree
Showing 14 changed files with 357 additions and 328 deletions.
47 changes: 47 additions & 0 deletions bat/README.md
Expand Up @@ -72,6 +72,49 @@ properties:
security_groups: security_groups:
- bat - 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 ## EC2 Networking Config


### On EC2 with AWS-provided DHCP networking ### 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 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. `22` and `4567` to the bat security group.


## OpenStack Networking Config

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

## Running BAT ## Running BAT


When all of the above is ready, running `bundle exec rake bat:env` will verify environment variables are set correctly. 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" %> version: <%= properties.release || "latest" %>


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


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


networks: networks:

- name: static
type: vip
cloud_properties: {}

- name: default - 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 type: dynamic
<% if_p('dns_nameserver') do |dns_nameserver| %> <% if_p('dns_nameserver') do |dns_nameserver| %>
dns: dns:
- <%= dns_nameserver %> - <%= dns_nameserver %>
<% end %> <% end %>
<% if properties.security_group %> <% if properties.security_groups %>
cloud_properties: cloud_properties:
security_groups: security_groups:
- <%= properties.security_group %> - <%= properties.security_groups %>
<% else %> <% else %>
cloud_properties: {} cloud_properties: {}
<% end %> <% end %>
- name: static <% end %>
type: vip
cloud_properties: {}


resource_pools: resource_pools:
- name: common - name: common
Expand All @@ -47,6 +77,9 @@ resource_pools:
version: <%= properties.stemcell.version %> version: <%= properties.stemcell.version %>
cloud_properties: cloud_properties:
instance_type: m1.small instance_type: m1.small
<% if properties.key_name %>
key_name: <%= properties.key_name %>
<% end %>
<% if properties.password %> <% if properties.password %>
env: env:
bosh: bosh:
Expand Down
1 change: 0 additions & 1 deletion bosh_openstack_cpi/lib/cloud/openstack.rb
Expand Up @@ -20,7 +20,6 @@ module OpenStackCloud; end
require "cloud" require "cloud"
require "cloud/openstack/helpers" require "cloud/openstack/helpers"
require "cloud/openstack/cloud" require "cloud/openstack/cloud"
require "cloud/openstack/connection"
require "cloud/openstack/registry_client" require "cloud/openstack/registry_client"
require "cloud/openstack/tag_manager" require "cloud/openstack/tag_manager"
require "cloud/openstack/version" require "cloud/openstack/version"
Expand Down

0 comments on commit 140ab42

Please sign in to comment.