Generate a unique enrollment ID for use as an idempotency token during enrollment #2820
Open
1 of 2 tasks
Labels
Team:Elastic-Agent
Label for the Agent team
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
This is the agent side implementation for elastic/fleet-server#2254 where duplicate agents can be created at scale when the enrollment API request experiences an error that results in partial server side success.
The agent should generate a V4 random UUID for use as an idempotency token during enrollment to ensure that retrying enrollment does not generate duplicate agents in Fleet. The idempotency token will be supplied in the new
enrollment_id
parameter of the enrollment request added in elastic/fleet-server#2655.The UUID should be written to disk, ideally it is persisted in the agent's encrypted store. The enrollment ID should be deleted after we have confirmed the enrollment has succeeded, ideally after the first Fleet checkin succeeds.
We will likely also need a flag to force regenerating the enrollment idempotency token for cases where a server side issue causes enrollment for a particular idempotency token to fail repeatedly. This could also prevent issues if someone clones a VM image where a previous enrollment attempt had already happened.
Depends on:
Relates to:
The text was updated successfully, but these errors were encountered: