How to collect logs from BOSH-deployed instance group or single instance with bosh CLI
search cancel

How to collect logs from BOSH-deployed instance group or single instance with bosh CLI

book

Article ID: 293664

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

BOSH-deployed instances logs can be download from Ops Manage web UI. However, only instance group logs can be downloaded instead of single instance. As an alternative option, single instance or instance group logs can be downloaded with BOSH CLI - `bosh logs` command. 

Environment

Product Version: 3.0

Resolution

First, you will need to SSH into the Ops Manager VM and authenticate with the BOSH Director VM. Follow the steps listed below.


Capture BOSH logs for all VMs in your deployment

  1. Run BOSH logs against the deployment name to capture logs for all instances in your deployment. 
    bosh -e <MY-ENV> -d <MY-DEPLOYMENT> logs
  2. When the BOSH task has completed it will supply the full path to the downloaded logs 
    Downloading resource '########' to '/home/ubuntu/cf-#######.tgz'...
  3. The user can now download the logs from the Ops Manager VM and upload them to the Salesforce ticket if required.


Capture BOSH logs for all instances in a particular instance group in your deployment or just a single instance

  1. List VMs in your deployment 
    bosh -e <MY-ENV> -d <MY-DEPLOYMENT> is
  2. Sample output shows that VMs are listed in the form of <INSTANCE_GROUP>/<INSTANCE_ID>
    Instance                                                            Process State  AZ   IPs            VM CID                                   VM Type      Active
    clock_global/419248e9-3485-49ff-8994-09aa2543d5fe                   running        az1  10.###.##.##   vm-7ca5bb89-91a7-####-####-ccb55a8a8fb1  medium.disk  true
    cloud_controller/690610bb-e96c-43db-94bd-bbad1ccd8c18               running        az1  10.###.##.##   vm-4b3c4a20-ecae-####-####-a34c240f9aea  medium.disk  true
    cloud_controller_worker/e4ce97cd-aa02-4fe0-8462-de3f5ad7f399        running        az1  10.###.##.##   vm-1e105647-0221-####-####-342cc3c47418  micro        true
    credhub/0f2ad706-d72d-4581-96d6-86f683cf5021                        running        az1  10.###.##.##   vm-28be61a7-1218-####-####-7b8cd935fe22  large        true
    diego_brain/f799f2f7-e712-4c1d-a5df-456811ccf739                    running        az1  10.###.##.##   vm-8cf6d4a0-13d4-####-####-e02f4db2da30  small        true
    diego_cell/025a187a-abd8-4e2b-a36d-224f75ff3662                     running        az1  10.###.##.##   vm-266e09fc-7b4d-####-####-709bf56fd83b  xlarge.disk  true
    diego_cell/6b0264dd-3ce7-48ca-afa5-5937a2d606d9                     running        az1  10.###.##.##   vm-5bbeefb3-c6c5-####-####-2ba2138666d6  xlarge.disk  true
  3. If you need to capture the BOSH logs for all diego_cells, run the following:
    bosh -e <MY-ENV> -d <MY-DEPLOYMENT> logs <INSTANCE-GROUP>
  4. If you just want to capture the BOSH logs for a single VM then run the following: 
    bosh -e MY-ENV -d MY-DEPLOYMENT logs INSTANCE-GROUP/INSTANCE-ID
  5. In step 3 or 4, the BOSH task will complete with a full path to the location of the downloaded files on the Ops Manager VM.
    Downloading resource '####' to '/home/ubuntu/cf-####.diego_cell-####.tgz'...