This feature is available with bosh-release v255.4+ and on 3213+ stemcell series.
It's common for software to need to know where it was deployed so that it can make application level decisions or propagate location information in logs and metrics. Director instance specific information in multiple ways:
Via ERB templates¶
spec variable in ERB templates to get access to AZ, deployment name, ID, etc.
Accessing information over filesystem might be useful when building core libraries so that explicit configuration is not required. Each VM has a
/var/vcap/instance directory that contains following files:
vcap@7e87e912-35cc-4b43-9645-5a7d7d6f2caa:~$ ls -la /var/vcap/instance/ total 24 drwxr-xr-x 2 root root 4096 Mar 17 00:06 . drwxr-xr-x 11 root root 4096 Mar 17 00:16 .. -rw-r--r-- 1 root root 2 Mar 17 00:07 az -rw-r--r-- 1 root root 10 Mar 17 00:07 deployment -rw-r--r-- 1 root root 36 Mar 17 00:07 id -rw-r--r-- 1 root root 3 Mar 17 00:07 name