Skip to content

Instantly share code, notes, and snippets.

@nikhilsuvarna
Last active October 18, 2018 15:19
Show Gist options
  • Save nikhilsuvarna/aa2593af5e45721049e3f1c774e238c9 to your computer and use it in GitHub Desktop.
Save nikhilsuvarna/aa2593af5e45721049e3f1c774e238c9 to your computer and use it in GitHub Desktop.
  1. Establish the process-guid for the app :
 cf curl /v2/apps/$(cf app <app_name> --guid)| jq -r '.metadata.guid + "-" + .entity.version'
b06b2901-2093-4be4-9f37-f7788d04ce8c-ff93f0e2-285f-4f18-a6fc-806802f3dde9
  1. Find the hosts where the app instances are running
cf curl v2/apps/$(cf app healthwatch-api --guid)/stats | grep host
         "host": "10.193.73.14",
         "host": "10.193.73.13",
  1. Identify the diego cell you want to ssh to by running bosh vms | grep <cell_ip>

  2. bosh ssh to the diego cell (grab the cell_id from step 3.)

  3. Once in the diego cell, as root, run the following command to grab the container_guid/instance_guid :

cfdot actual-lrp-groups-for-guid <process_guid_from_step_1> | jq '.instance | select (.address == "<diego_cell_ip>")' | jq .instance_guid
  1. Run the following command to get access to the container :
/var/vcap/packages/runc/bin/runc exec -t <instance_guid> /bin/bash

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