BOSH add-on results in error Colocated job is already added to the instance group
search cancel

BOSH add-on results in error Colocated job is already added to the instance group

book

Article ID: 387226

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

This KB is relevant if you are attempting to apply a BOSH add-on and encounter this error during BOSH deploy or apply changes.

Error:
Error: Colocated job '<redacted>' is already added to the instance group '<redacted>'

This error occurs after updating runtime-config for add-on configuration - 

 bosh update-runtime-config <runtime config>

 

Cause

This error typically indicates that BOSH is attempting to apply a job multiple times to a instance group. This may happen if you have an instance group defined multiples times in runtime config and the include and exclude statements are not defined properly.

Resolution

The runtime config needs to be corrected to properly define BOSH add-ons.

If you have a BOSH add-on that needs to get installed to multiple deployments but with different configs, then you would want to use a runtime-config such as below with bosh addon listed twice with different names.

Example runtime config: 

addons:
name: bosh-addon-abc
- exclude: lifecycle: errand include: deployments: - <deployment 1> - <deployment 2> jobs: - name: addon-agent
properties:
config: <config A>
name: bosh-addon-xys
- exclude:
lifecycle: errand
include:
deployments:
- <deployment 3>
- <deployment 4>
jobs:
- name: addon-agent
properties:
config: <config B>

It's also important that add-on needs to define deployments explicitly in include block. If you attempt to configure bosh add-on for ALL deployments (no include deployments: block) then you will run into colocated error if the job is duplicated within another bosh add-on.