How to access Bosh Director console and restore an outdated Cloud Config - cloudfoundry/cloud_controller_ng GitHub Wiki
- Run
bosh envand get the address of the Bosh director E.g.
Using environment 'https://35.188.1.2:25555' as client 'admin'
- ssh on to the Bosh director
ssh [email protected] -i keypair/bosh.pem
- 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 [email protected]:/tmp/config.yml config.yml
And upload it back to the bosh director:
bosh update-cloud-config config.yml