Pivotal/BOSH/CLI
From r00tedvw.com wiki
BOSH | BOSH CLI
Contents |
CLI Quick Reference
bosh create-env
- creates a bosh environment with the director
bosh create-env <path to bosh.yml> \
- --state <path to state.json> \
- -o <path to cpi.yml> \
- -o <path to outbound-network.yml> \
- -o <path to bosh-lite.yml> \
- -o <path to bosh-lite-runc.yml> \
- -o <path to jumpbox-user.yml> \
- --var-store <path to creds.yml> \
- -v director_name="<bosh director name> \
- -v internal_ip=<internal ip for bosh director> \
- -v internal_gw=<internal ip for gateway> \
- -v internal_cidr=<internal cidr range for network> \
- -v outbound_network_name=<name for outbound nat network>
~$ bosh create-env ~/Git/workspace/bosh-deployment/bosh.yml \ --state ./state.json \ -o ~/Git/workspace/bosh-deployment/virtualbox/cpi.yml \ -o ~/Git/workspace/bosh-deployment/virtualbox/outbound-network.yml \ -o ~/Git/workspace/bosh-deployment/bosh-lite.yml \ -o ~/Git/workspace/bosh-deployment/bosh-lite-runc.yml \ -o ~/Git/workspace/bosh-deployment/uaa.yml \ -o ~/Git/workspace/bosh-deployment/credhub.yml \ -o ~/Git/workspace/bosh-deployment/jumpbox-user.yml \ --vars-store ./creds.yml \ -v director_name=bosh-lite \ -v internal_ip=192.168.50.6 \ -v internal_gw=192.168.50.1 \ -v internal_cidr=192.168.50.0/24 \ -v outbound_network_name=NatNetwork
bosh env
- shows your current environment details
bosh -e <environment alias> env
~$ bosh -e vbox env Using environment '192.168.50.6' as client 'admin' Name bosh-lite UUID f2d2eb92-5866-4c5d-8822-7c09ff0f5fc0 Version 266.4.0 (00000000) CPI warden_cpi Features compiled_package_cache: disabled config_server: enabled dns: disabled snapshots: disabled User admin Succeeded
bosh alias-env
- sets up an alias name for the environment
bosh alias-env vbox -e <director ip> --ca-cert <(bosh int ./creds.yml --path /director_ssl/ca)
~$ bosh alias-env vbox -e 192.168.50.6 --ca-cert <(bosh int ./creds.yml --path /director_ssl/ca) ~$ export BOSH_CLIENT=admin ~$ export BOSH_CLIENT_SECRET=`bosh int ./creds.yml --path /admin_password`
- sets up an alias name for the environment from ops man director on vsphere. You may need to ssh into the ops manager first.
bosh2 alias-env MY-ENV -e DIRECTOR-IP-ADDRESS --ca-cert /var/tempest/workspaces/default/root_ca_certificate
~$ bosh2 alias-env myenv -e 10.193.81.11 --ca-cert /var/tempest/workspaces/default/root_ca_certificate
bosh environments
- shows all the available environments
bosh environments
~$ ubuntu@opsmanager-2-2:~$ bosh environments URL Alias 10.193.81.11 env 1 environments Succeeded
bosh log-in
- log in to the director. alias is
l
bosh -e <env alias> login-in
~$ bosh -e my-env l User (): admin Password ():
NOTE: you can set the username and password as environment variables to avoid typing them in:
~$ export BOSH_CLIENT=admin ~$ export BOSH_CLIENT_SECRET=`bosh int ./creds.yml --path /admin_password`
- for bosh cli, use the director credentials found in the bosh director tile.
bosh log-out
- log out of the director
bosh -e <env alias> log-out
~$bosh -e vbox log-out Logged out from '192.168.50.6' Succeeded
bosh vms
- List all the virtual machines create and managed by BOSH
bosh -e env vms
~$ bosh -e myenv vms
bosh deployments
- List all of the deployments managed by BOSH
bosh -e env deployments
~$ bosh -e myenv deployments
bosh -d
- specify specific deployment and then specify a command
bosh -e env -d <deployment name> <command>
~$ bosh -e myenv -d cf-3dc74d032cbc62c7fd76 errands