Skip to content

Instantly share code, notes, and snippets.

@squeedee
Created March 24, 2014 22:12
Show Gist options
  • Save squeedee/9750420 to your computer and use it in GitHub Desktop.
Save squeedee/9750420 to your computer and use it in GitHub Desktop.
Docs for finding a droplet within a bosh-lite instance

Find a droplet on Bosh-Lite CF

Locate the db connection string

Find the cloud controller db connection string

bosh ssh api_z1
grep postgres `find /var/vcap/data/jobs/cloud_controller_ng/ cloud_controller_ng.yml`
exit # leave the container

The last entry is the connection string for postgres.

Usually iy is: postgres://ccadmin:[email protected]:5524/ccdb

Fetch the droplet hash for your app

Get all apps and read through:

$ psql -h 10.244.0.30 -p 5524 -U ccadmin ccdb -c 'select droplet_hash, name from apps;'

or filter

$ psql -h 10.244.0.30 -p 5524 -U ccadmin ccdb -c "select droplet_hash, name from apps where name='return-of-the-jedi';"

sample output:

               droplet_hash               |        name
------------------------------------------+--------------------
 9a39178adb8b15c72ed2fb8da39091472b3809b7 | return-of-the-jedi
(1 row)

todo.. finish

$ bosh ssh api_z1
$ DROPLET=`find /var/vcap/store/10.244.0.34.xip.io-cc-droplets -name <app hash here>`

find some way of sending the contents of $DROPLET to your host :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment