Skip to content

How to access Bosh Director console and restore an outdated Cloud Config

Tim Downey edited this page Sep 6, 2017 · 1 revision
  1. Run bosh env and get the address of the Bosh director E.g.
Using environment 'https://35.188.1.2:25555' as client 'admin'
  1. ssh on to the Bosh director
ssh jumpbox@35.188.1.2 -i keypair/bosh.pem
  1. Start up the Bosh director Ruby console
cd /var/vcap/jobs/director/bin/
./director_ctl console

You can now use the Bosh director's Sequel models to query the Cloud Config table:

Most likely, you'll want the second newest cloud-config, assuming an incompatible cloud-config was just pushed to the director. The easiest way to find it is this way:

Bosh::Director::Models::CloudConfig.order(:id).map(&:created_at)

And choose the second newest config. In this example, there were 12 configs, so we select config[10]. To dump the YAML from a CloudConfig to disk, you'll do something like this:

File.open("/tmp/config.yml", 'w') { |fd| fd.write(YAML.dump(Bosh::Director::Models::CloudConfig.order(:id)[10].properties)) }

Then just transfer this to your workstation:

scp -i keypair/bosh.pem jumpbox@35.188.1.2:/tmp/config.yml config.yml

And upload it back to the bosh director:

bosh update-cloud-config config.yml
Clone this wiki locally