Store information in consul : kv or services

Hi everyone

I got some KVM server and I would like to store the list of vm running on each server in consul, but I would like to have this list as dynamic as possible.

If I use a consul service I don’t see where I can store the list because the metadata are limited to 64 items.

If I use consul kv I don’t see how I can delete those key when the server are down.

Any idea ?

Regards

HI @jas01,

Have you considered registering each of the VMs, or rather the services on the VMs, as actual services in Consul?

That would allow you to have dynamic list that is not limited in size, unlike service metadaa.

Well not sure what you mean, from where ? the host or the guest ?When you say «registering» in KV or services ?

Well I already think of that, but the problem are with that I’m loosing the information on which kvm the VM running a «this moment».

The purpose is to have a file (produce by something like consul-template) where I can have the information (dynamically) for each VM on which KVM it’s currently running.

This file will be use by… humans,but also and most important by our software configuration management (puppet) and our monitoring service.

Are you using a particular orchestrator to create these VMs, or are you just creating them using some other tooling?

we are using puppet since 2014 so we got a lot of custom modules and automation.

Regards