post hook into bosh delete vm command


estein@...
 

Hi,

We are interested in deploying a zabbix agent via a bosh package.  We want the package to automatically add the VM once created to the Zabbix monitor, which can be done via post-start or post-deployment I believe.  However, I can't figure out how to do the opposite: namely in the case where a VM is deleted, we need it's entry in the Zabbix monitor to be deleted.  I know the APIs that allows the deletion and we have a Java application that can do it, but is there a way to hook into that delete mechanism?  Drain/post-stop is called regardless of whether the VM is stopped or deleted, so I don't think that will work.

Hoping someone knows.  Thanks.


adrian.kurt@...
 

Hi

 

First of all I suggest adding your Zabbix integration as a regular bosh-release instead of a package. You can use the runtime-config to add it to all deployed vms.

 

If I remember correctly there are two parameters passed to the drain script and based on those you should be able to find out if the vm is about to be deleted.

 

Kind regards

Adrian

 

From: cf-bosh@... [mailto:cf-bosh@...] On Behalf Of estein@...
Sent: Mittwoch, 20. Juni 2018 22:18
To: cf-bosh@...
Subject: [cf-bosh] post hook into bosh delete vm command

 

Hi,

We are interested in deploying a zabbix agent via a bosh package.  We want the package to automatically add the VM once created to the Zabbix monitor, which can be done via post-start or post-deployment I believe.  However, I can't figure out how to do the opposite: namely in the case where a VM is deleted, we need it's entry in the Zabbix monitor to be deleted.  I know the APIs that allows the deletion and we have a Java application that can do it, but is there a way to hook into that delete mechanism?  Drain/post-stop is called regardless of whether the VM is stopped or deleted, so I don't think that will work.

Hoping someone knows.  Thanks.


Benjamin Gandon
 

Hi,

I contributed recently the details about this « cluster scale-in » condition in the BOSH documentation:

And there are example here:
and here:

But for detecting BOSH-manged nodes showing up and going, maybe you should see how the prometheus team solves this problem. Especially, look how the node_exporter list all nodes that are managed by the BOSH server in order to feed the Prometheus system with the accurate list.

Best,
/Benjamin GANDON

Le 21 juin 2018 à 07:54, adrian.kurt@... a écrit :

Hi
 
First of all I suggest adding your Zabbix integration as a regular bosh-release instead of a package. You can use the runtime-config to add it to all deployed vms.
 
If I remember correctly there are two parameters passed to the drain script and based on those you should be able to find out if the vm is about to be deleted.
 
Kind regards
Adrian
 
From: cf-bosh@... [mailto:cf-bosh@...] On Behalf Of estein@...
Sent: Mittwoch, 20. Juni 2018 22:18
To: cf-bosh@...
Subject: [cf-bosh] post hook into bosh delete vm command
 
Hi,

We are interested in deploying a zabbix agent via a bosh package.  We want the package to automatically add the VM once created to the Zabbix monitor, which can be done via post-start or post-deployment I believe.  However, I can't figure out how to do the opposite: namely in the case where a VM is deleted, we need it's entry in the Zabbix monitor to be deleted.  I know the APIs that allows the deletion and we have a Java application that can do it, but is there a way to hook into that delete mechanism?  Drain/post-stop is called regardless of whether the VM is stopped or deleted, so I don't think that will work.

Hoping someone knows.  Thanks. 



estein@...
 

That actually does sound perfect.  I'll check it out.


estein@...
 

Sorry, yes, I meant as a bosh release.  I'm still getting used to the nomenclature. 


Marco Voelz
 

Hi,


Please note that all of the things Benjamin mentioned are mere workarounds rather than a desireable solution. We're looking for feedback for the proposal at https://github.com/cloudfoundry/bosh-notes/blob/master/proposals/drain-actions.md which would introduce a way for scripts to detect state changes in a drain script.


Warm regards

Marco



From: cf-bosh@... <cf-bosh@...> on behalf of estein@... <estein@...>
Sent: Thursday, June 21, 2018 5:20:56 PM
To: cf-bosh@...
Subject: Re: [cf-bosh] post hook into bosh delete vm command
 
Sorry, yes, I meant as a bosh release.  I'm still getting used to the nomenclature. 


Benjamin Gandon
 

Indeed, thank you for mentioning it Marco!

I was focused towards providing a working solution in my answer, not broadening the problem too much.

I definitely support this proposal. From the very start I found the {"persistent_disk":0} solution very workaround-ish indeed. For in-memory database, or anything stateless that needs draining, this currenty-state-of-the-art-workaround would not work.

In which form are you expecting feedback or support?

Best,
Benjamin GANDON



Le 28 juin 2018 à 14:34, Marco Voelz <marco.voelz@...> a écrit :

Hi,

Please note that all of the things Benjamin mentioned are mere workarounds rather than a desireable solution. We're looking for feedback for the proposal at https://github.com/cloudfoundry/bosh-notes/blob/master/proposals/drain-actions.md which would introduce a way for scripts to detect state changes in a drain script.

Warm regards
Marco


From: cf-bosh@... <cf-bosh@...> on behalf of estein@...<estein@...>
Sent: Thursday, June 21, 2018 5:20:56 PM
To: cf-bosh@...
Subject: Re: [cf-bosh] post hook into bosh delete vm command
 
Sorry, yes, I meant as a bosh release.  I'm still getting used to the nomenclature. 


Marco Voelz
 

Sorry Benjamin for not getting back to you earlier.

What we're looking for are concrete use-cases that either support our assumptions stated in the issue or invalidate them. So if you have a concrete scenario that's not yet showing up in https://github.com/cloudfoundry/bosh-notes/blob/master/proposals/drain-actions.md let us know.

We'd also like to hear from you if you're +1'ing any of the existing scenarios in the note.

Thanks and warm regards
Marco


From: cf-bosh@... <cf-bosh@...> on behalf of Benjamin Gandon <benjamin@...>
Sent: Thursday, July 12, 2018 12:12:59 PM
To: Discussions about the Cloud Foundry BOSH project.
Subject: Re: [cf-bosh] post hook into bosh delete vm command
 
Indeed, thank you for mentioning it Marco!

I was focused towards providing a working solution in my answer, not broadening the problem too much.

I definitely support this proposal. From the very start I found the {"persistent_disk":0} solution very workaround-ish indeed. For in-memory database, or anything stateless that needs draining, this currenty-state-of-the-art-workaround would not work.

In which form are you expecting feedback or support?

Best,
Benjamin GANDON



Le 28 juin 2018 à 14:34, Marco Voelz <marco.voelz@...> a écrit :

Hi,

Please note that all of the things Benjamin mentioned are mere workarounds rather than a desireable solution. We're looking for feedback for the proposal at https://github.com/cloudfoundry/bosh-notes/blob/master/proposals/drain-actions.md which would introduce a way for scripts to detect state changes in a drain script.

Warm regards
Marco


From: cf-bosh@... <cf-bosh@...> on behalf of estein@...<estein@...>
Sent: Thursday, June 21, 2018 5:20:56 PM
To: cf-bosh@...
Subject: Re: [cf-bosh] post hook into bosh delete vm command
 
Sorry, yes, I meant as a bosh release.  I'm still getting used to the nomenclature.