we are spawning multiple Windows Server instances from a golden image. These instances get destroyed and recreated daily.
For log collection we installed and enrolled the Elastic Agent in the golden image. We do get logs of all server instances, but have troubles when the agent policy is updated (it is not assigned correctly on all instances).
Therefore, we try to enroll each server instance individually. The easiest option for us would be, to just recreate the agent id on startup. We tried to delete the state.enc and fleet.enc file, but then the agent won't start.
Does anyone have experience with running Elastic Agent on server instances the are recreated regularly, e.g. for VDI servers? Elastic Agent for Kubernetes maps a static machine-id file but I could not find something similar for non-Kubernetes environments (apart from the encrypted fleet.enc and state.enc files).