Enabling bosh-init Debug Logs in the Ops Manager
search cancel

Enabling bosh-init Debug Logs in the Ops Manager

book

Article ID: 293610

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

The tools`bosh create-env` are used to create and update the Ops Manager Director, its VM and persistent disk, in an environment. These debug logging tools are sometimes used to investigate complex deployment issues.

 In Ops Manager 2.2 and newer, `bosh create-env` is used. 

 

Environment


Resolution

Before you get started, please confirm that there are no active installations. If you have Applied Changes, you need to wait for it to finish before you can make the following changes. Once you have confirmed this, proceed by SSH'ing into your Ops Manager VM.

Operations Manager 3.0.33

allows you to toggle bosh create-env debug logging in the Bosh Director Tile -> Director Config page. 

 

Workarounds prior to Operations Manager 3.0.33

  • For `bosh create-env` you'll want to edit `/home/tempest-web/tempest/web/app/models/deployer/executors/bosh_executor.rb`.  Edit the file based on the your version of Operations Manager as directed below.

For Operations Manager 2.x

  • Edit the file. Insert `BOSH_LOG_LEVEL=debug BOSH_LOG_PATH=/tmp/bosh_init.debug` as an argument to the `run_command` function inside `def bosh_create_env` just before `"/usr/local/bin/bosh ..."`. Save the file.

    Example: `run_command("BOSH_LOG_LEVEL=debug BOSH_LOG_PATH=/tmp/bosh_init.debug /usr/local/bin/bosh --no-color --non-interactive --tty #{command} #{temp_manifest_path}")`

For Operations Manager 3.0.0 <-> 3.0.32

  • Replace the 'run_command(args)' line in the bosh_create_env function with the following run_command that includes bosh debug environment variables. Please note the line numbers in the example may not be exactly the same in your environment. Save the file.

Example:

    348       def bosh_create_env(bosh_product_manifest, installation_dir, recreate_persistent_disk, recreate_director, skip_director_drain)
.
.
.
    360         #run_command(args)
    361         run_command(args, {env: {'BOSH_LOG_LEVEL' => 'debug', 'BOSH_LOG_PATH' => '/tmp/bosh_init.debug'} })

For all versions 

  • Run `service tempest-web stop && service tempest-web start && service nginx restart`. This will restart Ops Manager's UI.
  • Click Apply Changes and you should see in the output that `BOSH_LOG_LEVEL=debug` has been set. Actual log output will go to `/tmp/bosh_init.debug`, so you can run `tail -f /tmp/bosh_init.debug` on the Ops Manager VM to watch the logs.