1

What's the best way to work with dynamic IP addresses with BOSH? Currently we're setting static IP addresses for each machine we want to use, but we only really care that one of those VMs has a static IP address.

Is there a way to get information about other VMs running in the BOSH network from within a BOSH VM? Or just get dynamic information about the deployment from within the VM? Such as which machines are currently running on which IP addresses?

Eddie
  • 9,696
  • 4
  • 45
  • 58
Breedly
  • 12,838
  • 13
  • 59
  • 83

1 Answers1

0

It sounds like the recent introduction of "links" is worth a look for your use case.

Previously, if network communication was required between jobs, release authors had to add job properties to accept other job’s network addresses (e.g. a db_ips property). Operators then had to explicitly assign static IPs or DNS names for each instance group and fill out network address properties

This lets each job either expose or consume connections.

i.e. a DB exposes its connection

# Database job spec file.
name: database_job
# ...
provides:
- name: database_conn
  type: conn
  # Links always carry certain information, like its address and AZ.
  # Optionally, the provider can specify other properties in the link.
  properties:
  - port
  - adapter
  - username
  - password
  - name

And a Application can consume it.

# Application job spec file.
name: application_job
# ...
consumes:
- name: database_conn
  type: conn

The consuming job is provided with extra properties to use these addresses/info as needed, i.e.

#!/bin/bash
# Application's templated control script.
# ...
export DATABASE_HOST="<%= link('database_conn').instances[0].address %>"
export DATABASE_PORT="<%= link('database_conn').p('port') %>"
Eddie
  • 9,696
  • 4
  • 45
  • 58