Skip to content

Instantly share code, notes, and snippets.

@jghiloni
Created January 23, 2017 12:02
Show Gist options
  • Save jghiloni/dcce1bd659e50534eb76fccfadaaca11 to your computer and use it in GitHub Desktop.
Save jghiloni/dcce1bd659e50534eb76fccfadaaca11 to your computer and use it in GitHub Desktop.

BOSH Command Cheat Sheet for PCF 1.8

Logging in

  1. Log in to Ops Manager in the browser
  2. Go to the Ops Manager Director tile
  3. Go to the Status tab and note the IP address of the director VM
  4. Go to the Credentials tab and click the link that says Director Credentials. Note the username and password
  5. SSH into the Ops Manager VM
  6. Run
bosh --ca-cert /var/tempest/workspaces/default/root_ca_certificate target <IP FROM ABOVE>

and enter the credentials from the previous step

Deployments

  1. Log in to the director
  2. To see all available deployments (tiles), use bosh deployments
  3. To see the currently targeted deployment, use bosh deployment
  4. To set the currently targeted deployment, use bosh deployment /var/tempest/workspaces/default/deployments/<deployment-id>.yml

Health Monitoring

  1. Log in to the director
  2. To see the status of all VMs in the foundation, use bosh vms
    1. To see a more detailed version use bosh vms --details. This will include IP and actual IaaS VM name
    2. To see a more detailed version with health metrics instead, use bosh vms --vitals
    3. Either of those commands can be run with a deployment id immediately after vms in order to see info about one tile.
  3. To see info about the state of a single VM, run bosh ssh and choose the VM you wish to see. Once logged in, sudo to root and run monit summary, and if more detail is needed, monit status. If a component is failing, run monit restart <component name>.
  4. If a VM is still failing, run bosh restart <job-name>
  5. If a VM is non-responsive or missing, run bosh cck. This runs a "cloud check" (hence cck) and will note if any VMs or disks are missing and, if they are, will give you the option to recreate them.

Debugging a failed task

  1. Log in to the director
  2. Find the ID of the task you want to debug by running bosh tasks recent.
  3. Run bosh task <id> --debug for output.

Downloading logs from a BOSH-managed VM

  1. Log in to the director
  2. Find the name of the VM you want to download from. It will be in the form job_name/index (like diego_cell/0)
  3. Run bosh -scp job_name/index --download /path/to/file /destination-directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment