Using CheatSheets To Apply Best Practices

Bosh CheatSheet

Bosh CheatSheet

1.1 Bosh Frequent-Used

Name Command
List tasks bosh -d <deployment> tasks -ar, bosh tasks -r=10
List deployments and vms bosh deployments, bosh -d <deployment> vms
Bosh get current task output bosh -d <deployment> task $id --result
Bosh get task all detail log bosh -d <deployment> task -a --debug, bosh -d <deployment> task $id --debug
Delete a deployment bosh delete-deployment -d $deployment, bosh delete-deployment -d $deployment --force
Run errand, and avoid deleting the vms bosh -n -d <deployment> run-errand <errand_name> --keep-alive
Common Bosh Releases kubo-release, cfcr-etcd-release, docker-boshrelease, pxc-release
Reference Bosh CheatSheet, Tile CheatSheet, UAA CheatSheet, PKS CheatSheet

1.2 Bosh vs Kubernetes

Bosh – VM Lifecycle Management Kubernetes – Container Lifecycle Management
Bosh Envs Kubernetes Context
Bosh Deployment Kubernetes Deployment
Bosh Stemcell Docker Image
Bosh Manifest Kubernetes Configmap & Yaml
Bosh Monit Kubernetes Kubelet
Bosh Errand Kubernetes Job
Bosh Release Kubernetes Chart
Bosh Tile Kubernetes Helm
Bosh Director Kubernetes API server
Bosh Event Kubernetes Event
Bosh Task  
Bosh Agent  
Bosh Addon  
Bosh Ops manager No related feature: UI to customize your service

1.3 Bosh Challenges

Name Comment
More declarative End users define requirements via yaml files
More lightweight Use containers, instead of VMs to run errands
Support rolling upgrade Just like kubectl rollout
Retry a failed errand/task Currently we can do it. But it’s a lengthy manual process
Support tail -f Personally I don’t like the way of bosh logs

1.4 Bosh Concepts List

Name Comment
Reference Link: terminology, GitHub: cloudfoundry/bosh, CheatSheet: Cloudfoundry Tile & OpsManager
Reference YouTube: BOSH Release
Bosh Stemcells A versioned Operating System image. Download stemcell
Bosh Deployment An encapsulation of software and configuration that BOSH can deploy to the cloud.
Bosh Release Everything needed to make a software component deployable by BOSH.
Bosh Job Each release job represents a specific chunk of work that the release performs.
Bosh Package It contains vendored in software source and scripts to compile it.
Bosh Errand A short-lived job that can be triggered by an operator any time after the deploy.
Bosh Tile A *.pivotal file with everything needed to install/upgrade a PCF service. Tile CheatSheet
Bosh Manifest A YAML file that identifies one or more releases, stemcells and configurations
Bosh ops file A YAML file that includes multiple operations to be applied to a different YAML file.
Bosh Event Actions taken by the Director (via user or system control) are recorded as events
Bosh Director The Director is the orchestrator of deployments.
Bosh Addon A release job that is colocated on all VMs managed by the Director.
Bosh Agent A process that runs continuously on each VM that BOSH deploys. one Agent process per VM
Bosh Jumpbox A VM that acts as a single access point for the Director and deployed VMs.
Director Blobstore A repository where BOSH stores release artifacts, logs, stemcells, and other content, etc
Cloud ID (CID) ID returned from the Cloud identifying particular resource such as VM or disk.

1.5 Bosh Basic

Name Command
bosh apt install bosh-cli, /var/vcap/bosh/log
Interpolates variables bosh int /tmp/build/4dcXX/pks-lock/metadata --path=/ops_manager/username
List all bosh deployments bosh -n deployments, bosh -n deployments --json
Download log files bosh -d <deployment>_id logs
Show deployment manifest bosh manifest -d <deployment>
bosh config bosh cloud-config, bosh configs
List environment bosh env, bosh env --json, bosh envs
List all instances bosh instances
Get vms per deployment bosh -e $env -d <deployment> vms, bosh instances
Cloud consistency check bosh cloud-check -d <deployment>
List disks bosh disks -o

1.6 Bosh VM

Name Command
List vms bosh -d <deployment> vms
List vms with verbose info bosh -d <deployment> vms --vitals
Delete a vm bosh -d <deployment> delete-vm <vm-name>/<GUID>
SSH to vm bosh -e <env> -d <deployment> ssh <vm-name>/<GUID>
Run SSH commands bosh -e <env> -d <deployment> ssh <vm-name>/<GUID> -c "sudo cat /etc/hosts"


1.7 Bosh Deployment

Name Command
List bosh deployments bosh deployments
Show detail of one deployment bosh -d <deployment> deployment
Delete bosh deployment bosh -n -d <deployment> delete-deployment --force
Get deployment manifest yaml bosh manifest -d <deployment> > my.yaml
Run bosh deployment from yaml bosh deploy -d <deployment> my.yaml

1.8 Bosh Task

Name Command
List recent tasks bosh -d <deployment> tasks --recent
List all tasks bosh -d <deployment> tasks -ar
Attach to current task bosh -d <deployment> task -a
Get task by id bosh -d <deployment> task $id
Get task detail msg bosh -d <deployment> task $id --debug
Get all logs for a deployment bosh -d <deployment> logs
Get log for one vm bosh -d <deployment> logs $instance_name
List bosh events bosh events

1.9 Bosh Job – Skeleton

Name Command
Reference Example: kubo-release/jobs
provides Export resources for other bosh releases
consumes Use resources from other bosh releases
packages Packages get installed by bosh
templates Conf files

1.10 Bosh Errand

Name Command
List errands bosh errands -d <deployment>
Run errand in a new vm bosh -n -d <deployment> run-errand <errand_name> Link: run-errand
Run errand in a new vm with env alive bosh -n -d <deployment> run-errand <errand_name> --keep-alive
Run errand in an existing vm bosh -n -d <deployment> run-errand <errand_name> --instance=worker/instance-id=XXX

1.11 Bosh Blob

Name Command
Reference Link: Working with Blobs
Configure credential If you need to upload/download with S3/GCP buckets, make sure config/private.yml has been configured correctly
Add local file to blob bosh add-blob /tmp/<telegraf:1.7-alpine.tgz> container-images/telegraf:1.7-alpine.tgz
Upload blobs bosh upload-blobs, make sure config/private.yml is correct. blobs.yml will be automatically updated
List blob bosh blobs
Remove blob bosh remove-blob container-images/cadvisor-v0.31.0.tgz

1.12 Bosh Release – Basic

Name Command
List release bosh -n releases
Release folder /var/tempest/releases
Create a local release bosh create-release --tarball=myrelease-0.4.0.tgz
Inspect a release bosh inspect-release <my-release>/<release-version>
Export a release bosh -d <deployment> export-release <my-release>/<release-version> ubuntu-trusty/3586.36
Delete release bosh -n delete-release <my-release>/<release-version> --force
Upload release bosh -n upload-release, bosh -n upload-release /tmp/my-release-0.22.0.tgz
Reset release bosh reset-release GitHub ticket

1.13 Bosh Release – Creation

Name Command
Reference Link: Release creation
Create a release bosh create-release --tarball /tmp/my-release.tgz

1.14 Bosh Manifest

Name Command
Show bosh manifest bosh manifest -d <deployment> Link: manifest

1.15 Bosh Stemcell

Name Command
Floating stemcell Floating stemcells allow upgrade to the minor versions of stemcells but not the major versions.
Upload stemcell bosh -n upload-stemcell /tmp/stemcell.tgz
List stemcells bosh -n stemcells
Delete a stemcell bosh delete-stemcell <stemcell-name>/<stemcell-version>

1.16 Bosh Monit

Name Comment
List bosh deployed daemon processes sudo su -, monit summary
Restart a given daemon processes monit restart <process_name>

1.17 Bosh Tools

Name Comment
bbr bosh-backup-and-restore a framework for backing up and restoring BOSH deployments and BOSH Directors.
bbl bosh-bootloader a command line utility for standing up BOSH on multi-clouds
bpm BOSH process manager isolation of BOSH jobs to make they run on many different work schedulers instead of monit only

1.18 Online Help Usage

kubo@jumper:~$ bosh --help
  bosh [OPTIONS] <command>

Application Options:
  -v, --version          Show CLI version
      --config=          Config file path (default: ~/.bosh/config) [$BOSH_CONFIG]
  -e, --environment=     Director environment name or URL [$BOSH_ENVIRONMENT]
      --ca-cert=         Director CA certificate path or value [$BOSH_CA_CERT]
      --sha2             Use SHA256 checksums [$BOSH_SHA2]
      --parallel=        The max number of parallel operations (default: 5)
      --client=          Override username or UAA client [$BOSH_CLIENT]
      --client-secret=   Override password or UAA client secret [$BOSH_CLIENT_SECRET]
  -d, --deployment=      Deployment name [$BOSH_DEPLOYMENT]
      --column=          Filter to show only given column(s)
      --json             Output as JSON
      --tty              Force TTY-like output
      --no-color         Toggle colorized output
  -n, --non-interactive  Don't ask for user input [$BOSH_NON_INTERACTIVE]

Help Options:
  -h, --help             Show this help message

Available commands:
  add-blob               Add blob                                 
  alias-env              Alias environment to save URL and CA certificate
  attach-disk            Attaches disk to an instance             
  blobs                  List blobs                               
  cancel-task            Cancel task at its next checkpoint        (aliases: ct)
  clean-up               Clean up releases, stemcells, disks, etc.
  cloud-check            Cloud consistency check and interactive repair (aliases: cck, cloudcheck)
  cloud-config           Show current cloud config                 (aliases: cc)
  config                 Show current config for either ID or both type and name (aliases: c)
  configs                List configs                              (aliases: cs)
  cpi-config             Show current CPI config                  
  create-env             Create or update BOSH environment        
  create-release         Create release                            (aliases: cr)
  delete-config          Delete config                             (aliases: dc)
  delete-deployment      Delete deployment                         (aliases: deld)
  delete-disk            Delete disk                              
  delete-env             Delete BOSH environment                  
  delete-release         Delete release                            (aliases: delr)
  delete-snapshot        Delete snapshot                          
  delete-snapshots       Delete all snapshots in a deployment     
  delete-stemcell        Delete stemcell                           (aliases: dels)
  delete-vm              Delete VM                                
  deploy                 Update deployment                         (aliases: d)
  deployment             Show deployment information               (aliases: dep)
  deployments            List deployments                          (aliases: ds, deps)
  diff-config            Diff two configs by ID                   
  disks                  List disks                               
  environment            Show environment                          (aliases: env)
  environments           List environments                         (aliases: envs)
  errands                List errands                              (aliases: es)
  event                  Show event details                       
  events                 List events                              
  export-release         Export the compiled release to a tarball 
  finalize-release       Create final release from dev release tarball
  generate-job           Generate job                             
  generate-package       Generate package                         
  help                   Show this help message                   
  ignore                 Ignore an instance                       
  init-release           Initialize release                       
  inspect-release        List release contents such as jobs       
  instances              List all instances in a deployment        (aliases: is)
  interpolate            Interpolates variables into a manifest    (aliases: int)
  locks                  List current locks                       
  log-in                 Log in                                    (aliases: l, login)
  log-out                Log out                                   (aliases: logout)
  logs                   Fetch logs from instance(s)              
  manifest               Show deployment manifest                  (aliases: man)
  orphan-disk            Orphan disk                              
  recreate               Recreate instance(s)                     
  releases               List releases                             (aliases: rs)
  remove-blob            Remove blob                              
  repack-stemcell        Repack stemcell                          
  reset-release          Reset release                            
  restart                Restart instance(s)                      
  run-errand             Run errand                               
  runtime-config         Show current runtime config               (aliases: rc)
  scp                    SCP to/from instance(s)                  
  snapshots              List snapshots                           
  ssh                    SSH into instance(s)                     
  start                  Start instance(s)                        
  stemcells              List stemcells                            (aliases: ss)
  stop                   Stop instance(s)                         
  sync-blobs             Sync blobs                               
  take-snapshot          Take snapshot                            
  task                   Show task status and start tracking its output (aliases: t)
  tasks                  List running or recent tasks              (aliases: ts)
  unignore               Unignore an instance                     
  update-cloud-config    Update current cloud config               (aliases: ucc)
  update-config          Update config                             (aliases: uc)
  update-cpi-config      Update current CPI config                
  update-resurrection    Enable/disable resurrection              
  update-runtime-config  Update current runtime config             (aliases: urc)
  upload-blobs           Upload blobs                             
  upload-release         Upload release                            (aliases: ur)
  upload-stemcell        Upload stemcell                           (aliases: us)
  variables              List variables                            (aliases: vars)
  vendor-package         Vendor package                           
  vms                    List all VMs in all deployments          


Leave a Reply

Your email address will not be published. Required fields are marked *