How to prevent compilation VMs from being deleted?


R M
 

Hi there,

Is there any way of preventing compilation VMs from being destroyed if components fail to compile? I would like to be able to look into compilation VMs for troubleshooting the failures.

I tried following https://starkandwayne.com/blog/how-to-lock-vcap-password-for-bosh-vms/ but wasn't sure where to put following section wrt `cf-deploy`:

bosh -e bosh-1 -d cf deploy cf-deployment.yml -v system_domain=abc.com  --vars-store=/tmp/cloud-foundry/bosh/director-creds.yml

Thanks for any pointers ...

instance_groups:
- name: bosh
  properties:
    director:
      debug: 
        keep_unreachable_vms: true


Conor Nosal
 

`keep_unreachable_vms` is unrelated to compilation. Unreachable means that the bosh agent on the VM never connected to the director.

To keep compilation VMs, you want to set `reuse_compilation_vms` to true in the cloud config. https://bosh.io/docs/cloud-config/#compilation

On Tue, Jul 30, 2019 at 11:04 AM R M <rishi.investigate@...> wrote:
Hi there,

Is there any way of preventing compilation VMs from being destroyed if components fail to compile? I would like to be able to look into compilation VMs for troubleshooting the failures.

I tried following https://starkandwayne.com/blog/how-to-lock-vcap-password-for-bosh-vms/ but wasn't sure where to put following section wrt `cf-deploy`:

bosh -e bosh-1 -d cf deploy cf-deployment.yml -v system_domain=abc.com  --vars-store=/tmp/cloud-foundry/bosh/director-creds.yml

Thanks for any pointers ...

instance_groups:
- name: bosh
  properties:
    director:
      debug: 
        keep_unreachable_vms: true


R M
 

Thanks Conor - I already have `reuse_compilation_vms` set but I believe it is intended to be re-used for compilation.  BOSH seems to delete it anyway once the compilation job finishes/fails.


Benjamin Gandon
 

The point is to debug the compile scripts in the VM where they are running.
There is a way of dealing with VMs being destroyed after the compile script fail :

  1. Include a pause 10000 statement at the top of your compile script.
  2. bosh ssh to the compilation VM when it’s stuck on this pause 10000.
  3. Make a copy of the failing compile script with the pause 10000 removed.
  4. Run this copy with bash -x to inspect its behavior.
  5. Debug your script, fix it with an editor like vim, and iterate to step #4.
  6. When your compile script is working, quit the bosh ssh session and bosh scp it to your local machine, for inclusion in your BOSH Release.


Le 30 juil. 2019 à 18:02, R M <rishi.investigate@...> a écrit :

Thanks Conor - I already have `reuse_compilation_vms` set but I believe it is intended to be re-used for compilation.  BOSH seems to delete it anyway once the compilation job finishes/fails.