- post hook into bosh delete vm command
Re: post hook into bosh delete vm command
toggle quoted messageShow quoted text
I contributed recently the details about this « cluster scale-in » condition in the BOSH documentation:
And there are example 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.
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.
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.
Join email@example.com to automatically receive all group messages.