BOSH Commands
This page provides a comprehensive guide to essential BOSH commands for managing cloud deployments efficiently. BOSH (Billion Objects in the Cloud) is an open-source tool for release engineering, deployment, and lifecycle management of large, distributed systems.
List BOSH Deployments
To view all your BOSH deployments by name, use the following command:
bosh deps --column=name
Manage BOSH Deployment VMs
Inspect the virtual machines within a specific BOSH deployment, including vital resource usage metrics:
bosh -d <deployment> vms --vitals
SSH into BOSH Deployment VMs
Connect to a specific VM within a BOSH deployment via SSH. You can target an instance group by its GUID or index:
bosh -d <deployment> ssh <instance-group>/(<instance-guid>|<instance-index>)
Execute Commands on BOSH Deployment VMs
Run shell commands on all VMs belonging to a particular instance group within a BOSH deployment:
bosh -d <deployment> ssh <instance-group> -c '<shell-command>'
Manage BOSH Deployment Errands
List the available errands for a BOSH deployment and learn how to execute them:
# To list a BOSH deployment's errands:
bosh -d <deployment> errands
# To run a BOSH deployment errand
# .. on all VMs that have colocated errand:
bosh -d <deployment> run-errand <errand-name>
# .. on a specific VM:
bosh -d <deployment> run-errand <errand-name> --instance <instance-group>/(<instance-guid> | <instance-index>)
Monitor BOSH Deployment Tasks
Track the progress and status of tasks executed by BOSH:
# To list a BOSH deployment's tasks:
bosh -d <deployment> tasks
bosh -d <deployment> tasks --recent
# To show a BOSH deployment's task status and start tracking its output:
bosh -d <deployment> task <task-id>
Recreate BOSH Deployment VMs
Safely recreate VMs within a BOSH deployment to revert to a previous state or apply updates:
# .. safely drained and to last successful deployment state:
bosh -d <deployment> recreate <instance-group>/(<instance-guid>|<instance-index>)
# .. aggressively removed, ignoring bad agents and to current deployment state:
bosh -d <deployment> recreate --skip-drain --fix --no-converge <instance-group>/(<instance-guid> | <instance-index>)
For more advanced BOSH operations and detailed documentation, refer to the official BOSH documentation.