Bosh v2 - Addons - reference to collocated job name


Stevo Slavić <sslavic at gmail.com...>
 

Hello CF Bosh community,

Is it possible for Bosh v2 addon job to access name of collocated job?
With v1 I was able to configure properties of job and "addon" job together,
as addons were repeated.

E.g. say one has multiple deployments, each deploying a different job, each
job a cluster of x instances, each instance running on its own VM. And say
I wanted on every VM of every deployment to run an addon job which collects
and reports metrics from every VM. For metrics to have meaning, I need to
configure addon job properties with collocated job name (one owning the
instance, to which addon is collocated with) to use it in metric name. Is
that possible? Any docs or examples would be helpful.

Kind regards,
Stevo Slavic.


Danny Berger
 

Typically the release would generate those values dynamically based on the
`spec` variable (e.g. `<%= spec.job.name %>`. This way the values don't
need to be hard-coded anywhere, and they're compatible with the addons-type
approach you're describing. Some template properties you might find useful:

- spec.job.name - the instance group name
- spec.index - numeric number of the instance (being deprecated)
- spec.id - UUID of the instance
- spec.az - availability zone in cloud-config-aware deployments
- spec.deployment - the deployment name

Here's a page which discusses a bit more about templates and what is
available in the ERB -
http://bosh.io/docs/reference/jobs.html#use-of-properties.

Danny

On Tue, Sep 27, 2016 at 4:36 AM, Stevo Slavić <sslavic(a)gmail.com> wrote:

Hello CF Bosh community,

Is it possible for Bosh v2 addon job to access name of collocated job?
With v1 I was able to configure properties of job and "addon" job
together, as addons were repeated.

E.g. say one has multiple deployments, each deploying a different job,
each job a cluster of x instances, each instance running on its own VM. And
say I wanted on every VM of every deployment to run an addon job which
collects and reports metrics from every VM. For metrics to have meaning, I
need to configure addon job properties with collocated job name (one owning
the instance, to which addon is collocated with) to use it in metric name.
Is that possible? Any docs or examples would be helpful.

Kind regards,
Stevo Slavic.
--
Danny Berger


Stevo Slavić <sslavic at gmail.com...>
 

Thanks Danny,

I thought about this, wasn't sure what would happen, since addon is a job
and has a name associated, so wasn't clear which job name would be applied
if one was referenced in addon release spec. Would be nice if docs
clarified it, that it's a main job which owns the VM, and not addon job
name itself. Makes me wonder how could one access addon job name if needed.
Anyway, will give this approach a try, and thanks once more!

Kind regards,
Stevo Slavic.

On Thu, Sep 29, 2016 at 3:43 AM, Danny Berger <dberger(a)pivotal.io> wrote:

Typically the release would generate those values dynamically based on the
`spec` variable (e.g. `<%= spec.job.name %>`. This way the values don't
need to be hard-coded anywhere, and they're compatible with the addons-type
approach you're describing. Some template properties you might find useful:

- spec.job.name - the instance group name
- spec.index - numeric number of the instance (being deprecated)
- spec.id - UUID of the instance
- spec.az - availability zone in cloud-config-aware deployments
- spec.deployment - the deployment name

Here's a page which discusses a bit more about templates and what is
available in the ERB - http://bosh.io/docs/reference/jobs.html#use-of-
properties.

Danny


On Tue, Sep 27, 2016 at 4:36 AM, Stevo Slavić <sslavic(a)gmail.com> wrote:

Hello CF Bosh community,

Is it possible for Bosh v2 addon job to access name of collocated job?
With v1 I was able to configure properties of job and "addon" job
together, as addons were repeated.

E.g. say one has multiple deployments, each deploying a different job,
each job a cluster of x instances, each instance running on its own VM. And
say I wanted on every VM of every deployment to run an addon job which
collects and reports metrics from every VM. For metrics to have meaning, I
need to configure addon job properties with collocated job name (one owning
the instance, to which addon is collocated with) to use it in metric name.
Is that possible? Any docs or examples would be helpful.

Kind regards,
Stevo Slavic.


--
Danny Berger