Deploy OneAgent BOSH release on Cloud Foundry

The following guidelines apply to the deployment of Dynatrace OneAgent to Cloud Foundry VMs, including Cloud Foundry components, Diego cells, and Windows Diego cells.

There are two approaches for the deployment of the OneAgent BOSH release: immutable and lightweight. See the deployment strategies to decide which approach suits your needs.

Deploy an Environment ActiveGate (SaaS customers only).

Locate the download URLs located in the Environment API.

Get the latest versions of the BOSH release.

 curl -X GET https://{api-url}/api/v1/deployment/boshrelease/versions/unix -H /
 'Authorization: Api-Token {paas-token}'

Download the BOSH release.

Note: For Dynatrace SaaS, replace {api-url} with the address of the environment ActiveGate.

Confirm the checksum of the release.

Note: For Dynatrace SaaS, replace {api-url} with the address of the environment ActiveGate.

curl -H "Authorization: Api-Token {paas-token}"  /
https://{api-url}/api/v1/deployment/boshrelease/agent/windows/version/{version}/checksum?skipeMetadata=true

# this results in a response as follows (example):
{"sha256":"13658655d922aedc93951b545e8b881b76a77545ba6f8442828cfed53ffac3a8"}

# use the sha256 value to check against the file:
echo "13658655d922aedc93951b545e8b881b76a77545ba6f8442828cfed53ffac3a8 dynatrace-release.tgz" | sha256sum -c

# if the checksum matches the response is:
dynatrace-release.tgz: OK

# if the checksum doesn't match:
# dynatrace-release.tgz FAILED
# sha256sum: WARNING: 1 computed checksum did NOT match

Ensure that your BOSH CLI is successfully connected to the BOSH Director. For details, see the Cloud Foundry or VMWare Tanzu documentation.

Upload the BOSH release of OneAgent to the BOSH Director.

bosh -e my-env upload-release PATH-TO-BINARY/dynatrace-release.tgz

Create a runtime configuration named runtime-config-dynatrace.yml with the appropriate settings for your environment:

  • The apiurl key can be formatted in different ways depending on your environment:
Download
releases:
- name: dynatrace-oneagent
  version: 1.177.143
  #specify version of latest release

addons:
- name: dynatrace-oneagent-addon
  jobs:
  - name: dynatrace-oneagent
    release: dynatrace-oneagent
  include:
    stemcell:
    - os: ubuntu-xenial
  exclude:
    lifecycle: errand
  properties:
    dynatrace:
      environmentid: <environmentId>
      ###
      # The following keys are required for 1.177+ immutable OneAgent release
      apitoken:  <api-token>
      apiurl: https://{your-active-gate-url}/e/{environmentid}/api
      ###
      # optional properties below
      ###
      # Set to 'all' if you want to accept all self-signed SSL certificates.
      sslmode: all
      # Specify a direct download URL for Dynatrace OneAgent.
      # If this propery is set, BOSH will download OneAgent from this location.
      downloadurl: https://direct-download-url-for-agent
      # Specify the proxy to be used for communication. This setting is for BOSH only.
      # If you're using a proxy from an ActiveGate, leave this option commented out.
      proxy: https://your-proxy-url
      # Specify in which hostgroup the VMs in this deployments belong
      hostgroup: example_hostgroup
      # Define host tags for the VMs in this deployment
      hosttags: landscape=production team=my_team
      # Define custom properties for the VMs in this deployment
      hostprops: Department=Acceptance Stage=Sprint
      # Enable Infrastructure monitoring mode.
      # Set this to 1 to activate it
      infraonly: 0

#optional: extra addon configuration for Windows cells
- name: dynatrace-oneagent-windows-addon
  jobs:
  - name: dynatrace-oneagent-windows
    release: dynatrace-oneagent
  include:
    stemcell:
    - os: windows2016
  properties:
    dynatrace:
      environmentid: <environmentid>
      apitoken:  <api-token> # not the paas token for the immutable release
      # All of the optional properties for the Linux addon shown above (for example, apiurl, hostgroup) can also be used here.

Update the BOSH Director runtime configuration.

Note: Replace PATH with the path to the runtime-config-dynatrace.yml file.

bosh -e my-env update-runtime-config PATH/runtime-config-dynatrace.yml

This runtime configuration applies to all new BOSH deployments going forward.

If you have multiple BOSH runtime configurations with different OneAgent versions, you must delete the older ones using bosh delete-config.

Deploy your changes.

Since existing BOSH deployments won’t be automatically updated with the jobs specified in the runtime configuration, you need to redeploy them so that BOSH rolls out the OneAgent.

bosh -e my-env -d deployment deploy